Browse Source

cpuser表不存在的用户 用test登录

zyh
小久哥 3 years ago
parent
commit
3de354c111
  1. 9
      yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java

9
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java

@ -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());

Loading…
Cancel
Save