|
|
|
@ -96,7 +96,6 @@ public class AuthController {
|
|
|
|
|
WxCpMaJsCode2SessionResult session = wxCpService.jsCode2Session(dto.getCode()); |
|
|
|
|
log.info("企业微信登录信息:{}", session); |
|
|
|
|
cpuser = cpUserService.getByUserId(session.getUserId()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(cpuser)){ |
|
|
|
@ -106,18 +105,12 @@ public class AuthController {
|
|
|
|
|
AdminUserDO user = userService.getUserByUsername(cpuser.getUserId()); |
|
|
|
|
if (ObjectUtil.isEmpty(user)){ |
|
|
|
|
CommonResult.error(ErrorCodeConstants.USER_NOT_EXISTS.getCode(),"未发现绑定的企业用户,暂时无法登录,请联系管理员"); |
|
|
|
|
user = userService.getUserByUsername("test"); |
|
|
|
|
}else { |
|
|
|
|
user.setCpUserId(cpuser.getUserId()); |
|
|
|
|
userService.updateUser(UserConvert.INSTANCE.convertFromEntity(user)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// AuthLoginReqVO login = AuthLoginReqVO.builder()
|
|
|
|
|
// .username(cpuser.getUserId())
|
|
|
|
|
// .password("123456")
|
|
|
|
|
// .platform("wxcp").build();
|
|
|
|
|
// String token = authService.login(login, getClientIP(), getUserAgent());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LoginUser login = AuthConvert.INSTANCE.convert(user); |
|
|
|
|
String token = userSessionService.createUserSession(login, getClientIP(), getUserAgent()); |
|
|
|
|
|
|
|
|
|