xusl 2 年之前
父节点
当前提交
73353457e1

+ 2 - 2
backend/src/main/java/com/jiayue/ssi/handler/CustomAuthenticationFailureHandler.java

@@ -90,9 +90,9 @@ public class CustomAuthenticationFailureHandler extends SimpleUrlAuthenticationF
                     user.setLockTime(System.currentTimeMillis());
                     user.setLockTime(System.currentTimeMillis());
                     sysUserService.updateUser(user);
                     sysUserService.updateUser(user);
                     String noticeWay = "";
                     String noticeWay = "";
-                    if ("A".equals(sysPolicy.getExcLevelLogin())){
+                    if ("0".equals(sysPolicy.getExcLevelLogin())){
                         noticeWay = sysPolicy.getExcNoticeWayA();
                         noticeWay = sysPolicy.getExcNoticeWayA();
-                    } else if ("B".equals(sysPolicy.getExcLevelLogin())){
+                    } else if ("1".equals(sysPolicy.getExcLevelLogin())){
                         noticeWay = sysPolicy.getExcNoticeWayB();
                         noticeWay = sysPolicy.getExcNoticeWayB();
                     }
                     }
 
 

+ 2 - 2
backend/src/main/java/com/jiayue/ssi/handler/CustomAuthenticationSuccessHandler.java

@@ -79,9 +79,9 @@ public class CustomAuthenticationSuccessHandler extends SavedRequestAwareAuthent
             // 之前有用户登录过,本次将上次用户踢出下线。并通知管理员
             // 之前有用户登录过,本次将上次用户踢出下线。并通知管理员
             String noticeWay = "";
             String noticeWay = "";
             SysPolicy sysPolicy = sysPolicyService.getOne(new QueryWrapper<>());
             SysPolicy sysPolicy = sysPolicyService.getOne(new QueryWrapper<>());
-            if ("A".equals(sysPolicy.getExcLevelSameUser())){
+            if ("0".equals(sysPolicy.getExcLevelSameUser())){
                 noticeWay = sysPolicy.getExcNoticeWayA();
                 noticeWay = sysPolicy.getExcNoticeWayA();
-            } else if ("B".equals(sysPolicy.getExcLevelSameUser())){
+            } else if ("1".equals(sysPolicy.getExcLevelSameUser())){
                 noticeWay = sysPolicy.getExcNoticeWayB();
                 noticeWay = sysPolicy.getExcNoticeWayB();
             }
             }
 
 

+ 18 - 14
ui/src/views/sysManager/sysPolicy/index.vue

@@ -76,8 +76,8 @@ export default {
         {value: '1', label: '告警'}
         {value: '1', label: '告警'}
       ],
       ],
       excLevelOptions: [
       excLevelOptions: [
-        {value: 'A', label: 'A'},
-        {value: 'B', label: 'B'}
+        {value: '0', label: 'A'},
+        {value: '1', label: 'B'}
       ],
       ],
       form: {
       form: {
         loginFails: '',
         loginFails: '',
@@ -133,19 +133,23 @@ export default {
       })
       })
     },
     },
     onSubmit:debounce(function(){
     onSubmit:debounce(function(){
-      this.loading = true
-      this.$axios.put('/sysPolicyController', this.form).then((res) => {
-        if (res.code == 0) {
-          this.$message.success('策略配置保存成功')
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.loading = true
+          this.$axios.put('/sysPolicyController', this.form).then((res) => {
+            if (res.code == 0) {
+              this.$message.success('策略配置保存成功')
+            }
+            if (res.code == 1) {
+              this.$message.error(res.data)
+            }
+            this.loading = false
+          }).catch((error) => {
+            this.$message.error(error)
+            this.loading = false
+          })
         }
         }
-        if (res.code == 1) {
-          this.$message.error(res.data)
-        }
-        this.loading = false
-      }).catch((error) => {
-        this.$message.error(error)
-        this.loading = false
-      })
+      });
     },1000)
     },1000)
   }
   }
 }
 }