提交 308efb09 编写于 作者: Chongwen.jiang's avatar Chongwen.jiang

微信登录无用日志去除

上级 28572d59
流水线 #22213 已失败 于阶段
in 0 second
......@@ -285,9 +285,7 @@ public class LoginServiceImpl implements LoginService {
@Override
@Transactional
public LoginResult loginByWeChat(BaseRequest request) {
logger.info("loginByWeChat-request:{}", JSON.toJSONString(request));
WeChatEntity weChatEntity = null;
logger.info("loginByWeChat-bizType:{}", request.getBizType());
if (null != request.getBizType() &&
request.getBizType().equals(1)) {
// h5微信登录
......@@ -296,7 +294,6 @@ public class LoginServiceImpl implements LoginService {
// 原生微信登录
weChatEntity = WeChatUtils.getAuthorizationInfo(appId, appSecret, request.getWeChatCode());
}
logger.info("loginByWeChat-weChatEntity:{}", JSON.toJSONString(weChatEntity));
if (weChatEntity == null || StringUtils.isEmpty(weChatEntity.getOpenid()) || StringUtils.isEmpty(weChatEntity.getAccess_token())) {
throw new PicaException(AccountExceptionEnum.PICA_WECHAT_CODE_ERROR.getCode(), AccountExceptionEnum.PICA_WECHAT_CODE_ERROR.getMessage());
}
......@@ -305,11 +302,9 @@ public class LoginServiceImpl implements LoginService {
map.put("access_token", weChatEntity.getAccess_token());
map.put("openid", weChatEntity.getOpenid());
Map weChatUserInfo = WeChatUtils.getWeChatUserInfo(map, weChatURL);
logger.info("loginByWeChat-weChatUserInfo:{}", JSON.toJSONString(weChatUserInfo));
WeChatUserInfoEntity weChatUserInfoEntity = WeChatUtils.mergeWechatUserInfo(weChatUserInfo, weChatEntity.getOpenid());
String unionId = weChatUserInfoEntity.getUnionid();
AccountUnionEntity accountUnionEntity = accountUnionMapper.selectByUnionId(unionId);
logger.info("loginByWeChat-accountUnionEntity:{}", JSON.toJSONString(accountUnionEntity));
//是否绑定逻辑的判断
if (accountUnionEntity != null) {
Long acctId = accountUnionEntity.getAcctId();
......@@ -321,9 +316,7 @@ public class LoginServiceImpl implements LoginService {
//account.setMobilePhone(request.getMobile());
account.setMobilePhone("");
account.setRegisterSource(request.getSourceType());
logger.info("loginByWeChat-newToken...start");
String newToken = tokenUtils.generateToken(account);
logger.info("loginByWeChat-newToken...end");
LoginResult result = new LoginResult();
result.setToken(newToken);
result.setUserId(userId);
......@@ -337,7 +330,6 @@ public class LoginServiceImpl implements LoginService {
return result;
} else {
AccountWeChatInfoEntity entity = accountWeChatInfoMapper.selectByUnionId(unionId);
logger.info("loginByWeChat-数据是否存在...entity:{}", (entity == null));
//如果微信信息表数据不存在,就把用户信息存储到微信信息表中。
if (entity == null) {
processWeChatInfoUser(weChatUserInfoEntity, request.getWeChatLoginType());
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册