Commit ef1f5f0e by shenjunjie

添加手机号解析打印

parent 3e8f2122
......@@ -25,6 +25,8 @@ import com.zhiwei.brandkbs2.util.MongoUtil;
import com.zhiwei.brandkbs2.util.Tools;
import com.zhiwei.middleware.auth.pojo.CenterUser;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.mongodb.core.query.Criteria;
......@@ -48,6 +50,7 @@ import java.util.stream.Collectors;
*/
@Service("userServiceImpl")
public class UserServiceImpl implements UserService {
public static final Logger log = LogManager.getLogger(UserServiceImpl.class);
@Resource(name = "userDao")
private UserDao userDao;
......@@ -363,8 +366,9 @@ public class UserServiceImpl implements UserService {
info.put("code", loginVO.getCode());
HttpEntity<JSONObject> phoneNumberEntity = restTemplate.postForEntity(wxGetUserPhoneNumberUrl + accessToken, info, JSONObject.class);
if (null == phoneNumberEntity.getBody()) {
return ResponseResult.failure("手机号获取失败");
return ResponseResult.failure("手机号解析失败");
}
log.info("解析手机号,accessToken:{},wxGetUserPhoneNumberUrl:{},response:{}", accessToken, wxGetUserPhoneNumberUrl, phoneNumberEntity.getBody());
phoneNumber = Long.valueOf(phoneNumberEntity.getBody().getJSONObject("phone_info").getString("purePhoneNumber"));
}
User user = userDao.findOne("phoneNumber", phoneNumber);
......
spring.profiles.active=prod
spring.profiles.active=local
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment