Commit c6e44213 by levphon

V1.9.0 bug修复

1 parent e2cbb6f7
......@@ -145,11 +145,17 @@ public class LoginService {
}
public void linkWxAuth(String code, AppUser user) throws WxErrorException {
UserThirdAuth userThirdAuthByUserId = userThirdAuthMapper.selectByLoginTypeAndUserId(LoginType.WECHAT.getType(), user.getCuserId());
if (userThirdAuthByUserId != null) {
UserWechatAccount wechatAccount = wechatAccountMapper.selectByAuthId(userThirdAuthByUserId.getId());
//设置微信头像
user.setAvatar(wechatAccount != null ? wechatAccount.getAvatar() : null);
}
if (StringUtils.isNotEmpty(code)) {
WxMaJscode2SessionResult sessionResult = wxMaService.getUserService().getSessionInfo(code);
if (sessionResult != null) {
UserThirdAuth userThirdAuthByOpenid = userThirdAuthMapper.selectByOpenid(sessionResult.getOpenid());
UserThirdAuth userThirdAuthByUserId = userThirdAuthMapper.selectByLoginTypeAndUserId(LoginType.WECHAT.getType(), user.getCuserId());
log.info("code={},thirdAuthByUserId:{},thirdAuthByOpenid:{}", code, JSONUtil.toJsonStr(userThirdAuthByUserId), JSONUtil.toJsonStr(userThirdAuthByOpenid));
if (userThirdAuthByUserId == null) {
//关联c端用户openid
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!