|
|
|
@ -97,17 +97,11 @@ public class AuthController {
|
|
|
|
|
if ("wxcp".equals(dto.getCode())){ |
|
|
|
|
cpuser = cpUserService.getByUserId("test"); |
|
|
|
|
}else{ |
|
|
|
|
if (dto.getPlatform().equalsIgnoreCase("WX")){ |
|
|
|
|
//普通微信
|
|
|
|
|
WxMaJscode2SessionResult result = wxMaService.jsCode2SessionInfo(dto.getCode()); |
|
|
|
|
log.info("微信登录信息,{}", result); |
|
|
|
|
cpuser = cpUserService.getByUserId(result.getUnionid()); |
|
|
|
|
}else{ |
|
|
|
|
//企业微信
|
|
|
|
|
WxCpMaJsCode2SessionResult session = wxCpService.jsCode2Session(dto.getCode()); |
|
|
|
|
log.info("企业微信登录信息:{}", session); |
|
|
|
|
cpuser = cpUserService.getByUserId(session.getUserId()); |
|
|
|
|
} |
|
|
|
|
//企业微信
|
|
|
|
|
WxCpMaJsCode2SessionResult session = wxCpService.jsCode2Session(dto.getCode()); |
|
|
|
|
log.info("企业微信登录信息:{}", session); |
|
|
|
|
cpuser = cpUserService.getByUserId(session.getUserId()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(cpuser)){ |
|
|
|
@ -118,12 +112,8 @@ public class AuthController {
|
|
|
|
|
if (ObjectUtil.isEmpty(user)){ |
|
|
|
|
CommonResult.error(ErrorCodeConstants.USER_NOT_EXISTS.getCode(),"未发现绑定的企业用户,暂时无法登录,请联系管理员"); |
|
|
|
|
}else { |
|
|
|
|
if (dto.getPlatform().equalsIgnoreCase("WX")){ |
|
|
|
|
//暂时用微信小程序登录
|
|
|
|
|
}else{ |
|
|
|
|
user.setCpUserId(cpuser.getUserId()); |
|
|
|
|
userService.updateUser(UserConvert.INSTANCE.convertFromEntity(user)); |
|
|
|
|
} |
|
|
|
|
user.setCpUserId(cpuser.getUserId()); |
|
|
|
|
userService.updateUser(UserConvert.INSTANCE.convertFromEntity(user)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
AuthLoginReqVO login = AuthLoginReqVO.builder() |
|
|
|
|