Browse Source

20211124后端更新代码_2

mashengyi 3 years ago
parent
commit
4f27a5ba85

+ 4 - 0
src/main/java/com/jkcredit/invoice/controller/user/UserController.java

@@ -68,6 +68,10 @@ public class UserController {
     @LoginRequired
     public RespR user(@RequestBody User user) {
         user.setPassword(MD5Util.encrypt(user.getPassword()));
+        User user1 = userService.selectUserByUserName(user.getUserName());
+        if(null != user1){
+            return new RespR<>(Boolean.FALSE, "该用户已存在");
+        }
         return new RespR<>(userService.saveUser(user));
     }