From 41999d4a15c2f806e4f4c0d6025dce901f7db60a Mon Sep 17 00:00:00 2001 From: zhangjunwen Date: Fri, 5 Jul 2024 10:59:51 +0800 Subject: [PATCH] =?UTF-8?q?bug=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/web/service/UserDetailsServiceImpl.java | 7 +++++++ zfipc-ui/src/views/eqmanagement/eqcategory/index.vue | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/zfipc-server/zfipc-framework/src/main/java/com/inspur/framework/web/service/UserDetailsServiceImpl.java b/zfipc-server/zfipc-framework/src/main/java/com/inspur/framework/web/service/UserDetailsServiceImpl.java index 0951b0e..d5bb83b 100644 --- a/zfipc-server/zfipc-framework/src/main/java/com/inspur/framework/web/service/UserDetailsServiceImpl.java +++ b/zfipc-server/zfipc-framework/src/main/java/com/inspur/framework/web/service/UserDetailsServiceImpl.java @@ -3,6 +3,7 @@ package com.inspur.framework.web.service; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; @@ -33,6 +34,9 @@ public class UserDetailsServiceImpl implements UserDetailsService @Autowired private SysPermissionService permissionService; + @Value("${user.deptId}") + private Long deptId; + @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { @@ -52,6 +56,9 @@ public class UserDetailsServiceImpl implements UserDetailsService log.info("登录用户:{} 已被停用.", username); throw new ServiceException("对不起,您的账号:" + username + " 已停用"); } + else if (deptId != null && !deptId.equals(user.getDeptId())){ + throw new ServiceException("对不起,您的账号:" + username + " 不属于该工控机,无法登录"); + } passwordService.validate(user); diff --git a/zfipc-ui/src/views/eqmanagement/eqcategory/index.vue b/zfipc-ui/src/views/eqmanagement/eqcategory/index.vue index 606ed0c..275f6e7 100644 --- a/zfipc-ui/src/views/eqmanagement/eqcategory/index.vue +++ b/zfipc-ui/src/views/eqmanagement/eqcategory/index.vue @@ -495,11 +495,18 @@ export default { categoryName: [ { required: true, message: "设备类别名称不能为空", trigger: "blur" }, { - max: 50, + max: 20, message: "设备类别名称长度不能大于20个字", trigger: "blur", }, ], + categoryAbbr: [ + { + max: 20, + message: "设备别名名称长度不能大于20个字", + trigger: "blur", + }, + ], categoryDescription: [ { max: 500,