From c151ec18d4d302a6359a8ef4144835c254c842bc Mon Sep 17 00:00:00 2001
From: huliguo <2023611923@qq.com>
Date: 星期一, 12 五月 2025 16:17:10 +0800
Subject: [PATCH] 大屏加年份条件切换

---
 src/main/java/com/cl/controller/UserController.java |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/cl/controller/UserController.java b/src/main/java/com/cl/controller/UserController.java
index 5633681..4512823 100644
--- a/src/main/java/com/cl/controller/UserController.java
+++ b/src/main/java/com/cl/controller/UserController.java
@@ -9,10 +9,7 @@
 import com.cl.common.exception.user.LoginErrorException;
 import com.cl.common.exception.user.UserException;
 import com.cl.common.result.Result;
-import com.cl.pojo.dto.AddUserDTO;
-import com.cl.pojo.dto.EditUserDTO;
-import com.cl.pojo.dto.LoginDTO;
-import com.cl.pojo.dto.PasswordDTO;
+import com.cl.pojo.dto.*;
 import com.cl.pojo.entity.User;
 
 import com.cl.pojo.vo.UserVO;
@@ -72,7 +69,7 @@
         }
 
         if (!Objects.equals(user.getStatus(), StatusConstant.ENABLE)){
-            throw new LoginErrorException("该账号已被冻结");
+            throw new LoginErrorException("登录失败,当前账号已被冻结");
         }
         //校验密码是否正确
         if (!BCryptPasswordEncoder.matches(dto.getPassword(), user.getPassword())) {
@@ -91,6 +88,9 @@
         Map<String,String> map=new HashMap<>();
         map.put("token", token);
         map.put("is_first",user.getIsFirst().toString());
+        map.put("name",user.getName());
+        map.put("phone",user.getPhone());
+        map.put("id", String.valueOf(user.getId()));
         if (1==user.getIsFirst()){
             User user1 = new User();
             user1.setId(user.getId());
@@ -120,6 +120,17 @@
         return Result.success("修改成功");
     }
     /**
+     * 修改密码
+     */
+    @PutMapping("/passwordBeforeLogin")
+    @ApiOperation("修改密码(登录前)")
+    public Result<String> passwordBeforeLogin(@RequestBody @Valid PasswordBeforeLoginDTO passwordDTO) {
+        if (passwordDTO.getPhone().equals("admin")) {
+            return Result.error("管理员账号,不可操作");
+        }
+        return userService.passwordBeforeLogin(passwordDTO);
+    }
+    /**
      * 添加
      */
     @PostMapping("/addUser")

--
Gitblit v1.7.1