fix wechat login and share

main
Revers 10 months ago
parent 59dd76af7e
commit 330d19d924

@ -282,18 +282,7 @@ public class UserInfoService {
+ jwtUtil.createJWT(userInfo.getId(), userInfo.getNickName(), Constants.TOKEN_ROLE_APP_USER, userInfo.getAvatar());
}
public Result setPhoneNumber(String userid, String phoneNumber){
UserInfo userbyId = userInfoDao.getById(userid);
if(userbyId == null)
return Result.failed(StatusCode.USER_INVALID_USER_ID);
userbyId.setMobile(phoneNumber);
UserInfo save = userInfoDao.save(userbyId);
if(save != null)
return Result.success();
return Result.failed();
}
public List<UserInfo> orderByField(List<String> idList) {
return userInfoDao.orderByField(idList);

@ -87,7 +87,14 @@ public class WeChatAouth2Service {
public Result bindPhoneNumber(UserLoginDto user, WeChatBindReq weChatBindReq){
return userInfoService.setPhoneNumber(user.getUserId(),weChatBindReq.getMobile());
UserInfo userbyId = userInfoService.findById(user.getUserId());
if(userbyId == null)
return Result.failed(StatusCode.USER_INVALID_USER_ID);
userbyId.setMobile(weChatBindReq.getMobile());
userInfoService.bindMobile(userbyId);
return Result.success();
}
public Aouth2WeChatTokenResponse getAccessToken(String code){

Loading…
Cancel
Save