From 3ccf1e83d783e91598e2aa0ed9633a57fd101d55 Mon Sep 17 00:00:00 2001 From: nyoung <12190070+nyoungo@user.noreply.gitee.com> Date: Fri, 20 Sep 2024 11:16:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B1=BD=E4=BF=AE=E7=99=BB=E5=BD=95=20?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=20=E9=AA=8C=E8=AF=81=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/SysLoginController.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/app/controller/admin/SysLoginController.java b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/app/controller/admin/SysLoginController.java index 81743e5c..cab37536 100644 --- a/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/app/controller/admin/SysLoginController.java +++ b/dl-module-rescue/src/main/java/cn/iocoder/yudao/module/rescue/app/controller/admin/SysLoginController.java @@ -212,6 +212,10 @@ public class SysLoginController { AuthLoginReqVO authLoginReqVO = new AuthLoginReqVO(); authLoginReqVO.setUsername(loginBody.getUsername()); authLoginReqVO.setPassword(loginBody.getPassword()); + if(org.apache.commons.lang3.StringUtils.isEmpty(user.getMobile())){ + // 借用此字段设置需要填写手机号标志 为1时弹出验证手机号页面 + authLoginReqVO.setSocialState("1"); + } return success(loginService.login(authLoginReqVO)); } @@ -230,20 +234,16 @@ public class SysLoginController { } /** - * 汽修小程序注册方法 + * 汽修小程序更新用户手机号方法 * * @param registerVO 登录信息 * @return 结果 */ - @PostMapping("/registerQx") - @TenantIgnore + @PostMapping("/updateUserQx") public CommonResult registerQx(@RequestBody RegisterVO registerVO){ if(org.apache.commons.lang3.StringUtils.isEmpty(registerVO.getPhone())){ return error(500,"手机号不能为空"); } - if(org.apache.commons.lang3.StringUtils.isEmpty(registerVO.getPassword())){ - return error(500,"密码不能为空"); - } if(org.apache.commons.lang3.StringUtils.isEmpty(registerVO.getCode())){ return error(500,"验证码不能为空"); } @@ -253,12 +253,13 @@ public class SysLoginController { } redisCache2.deleteObject(registerVO.getPhone() + "-registerCode"); + + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); UserSaveReqVO userSaveReqVO = new UserSaveReqVO(); - userSaveReqVO.setUsername(registerVO.getPhone()); - userSaveReqVO.setPassword(passwordEncoder.encode(registerVO.getPassword())); + userSaveReqVO.setId(loginUser.getId()); userSaveReqVO.setMobile(registerVO.getPhone()); - userService.createUser(userSaveReqVO); - return success("注册成功"); + userService.updateUser(userSaveReqVO); + return success("成功"); }