18339543638 3 лет назад
Родитель
Сommit
cf8047e7e1

+ 3 - 2
nb-service/web-service/src/main/java/com/nb/web/service/system/common/dto/SysUserEditDTO.java

@@ -1,5 +1,6 @@
 package com.nb.web.service.system.common.dto;
 
+import com.nb.core.enums.SexEnum;
 import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -88,8 +89,8 @@ public class SysUserEditDTO implements Serializable {
     /**
      * 性别 1男;2女;3未知
      */
-    @NotBlank(message = "性别不能为空")
-    private String sex;
+    @NotNull(message = "性别不能为空")
+    private SexEnum sex;
 
     /**
      * 部门ID

+ 1 - 12
nb-service/web-service/src/main/java/com/nb/web/service/system/service/impl/SysUserServiceImpl.java

@@ -172,25 +172,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         if (!this.checkUniqueAccount(req.getAccount(), req.getId())) {
             throw new CustomException("账号已存在");
         }
-//        if (!this.checkUniqueEmail(req.getEmail(), req.getId())) {
-//            throw new CustomException("邮箱已存在");
-//        }
-//        if (!this.checkUniquePhone(req.getPhone(), req.getId())) {
-//            throw new CustomException("手机号已存在");
-//        }
-//        if (!this.checkUniqueStaffNumber(req.getStaffNumber(), req.getId())) {
-//            throw new CustomException("工号已存在");
-//        }
         if(req.getIsSys()!=null&&1==req.getIsSys()){
             try {
-                LoginUser loginUser = (LoginUser) StpUtil.getTokenSession().get(Constants.LOGIN_USER_KEY);
+                LoginUser loginUser =SecurityUtil.getLoginUser();
                 if(req.getIsSys()==null||!Boolean.TRUE.equals(loginUser.isSys())){
                     throw new CustomException("当前用户没有操作系统级别用户的权限");
                 }
             }catch (Exception e){
-//                StpUtil.logout();
                 throw new CustomException("当前用户没有操作系统级别用户的权限");
-//                throw NotLoginException.newInstance("", NotLoginException.DEFAULT_MESSAGE);
             }
         }
         // 当前用户不是超级管理员,不允许修改