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,