diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java index 6cb6f3b4..64acc883 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java @@ -71,6 +71,8 @@ public class AuthController { private CpUserService cpUserService; @Resource private WxCpService wxCpService; + @Resource + private UserSessionService userSessionService; @PostMapping("/login") @@ -109,11 +111,15 @@ public class AuthController { 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()); +// 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()); log.info("TOKEN:::{}",token); AuthLoginRespVO vo = AuthLoginRespVO.builder().token(token).user(cpuser).build();