From cfce577132832b5291c5bd3b171d7f4397d44643 Mon Sep 17 00:00:00 2001
From: 819527061@qq.com <123456>
Date: 星期二, 14 五月 2024 17:06:53 +0800
Subject: [PATCH] docs:参数加密

---
 src/views/main-components/user.vue |   49 ++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/src/views/main-components/user.vue b/src/views/main-components/user.vue
index 2d18402..a37dc1d 100644
--- a/src/views/main-components/user.vue
+++ b/src/views/main-components/user.vue
@@ -36,6 +36,7 @@
 import { getOtherSet } from "@/api/index";
 import util from "@/libs/util.js";
 import changePass from "@/views/change-pass/change-pass";
+import {getSessionStore} from "../../libs/storage";
 export default {
   name: "user",
   components: {
@@ -53,10 +54,44 @@
   data() {
     return {
       showChangePass: false,
+      flag:0,
     };
   },
   methods: {
-    init() {},
+    init() {
+      let psw = this.getStore("userInfo");
+      psw = JSON.parse(psw).description;
+      this.checkStrengthValue(psw);
+    },
+    checkStrengthValue(v) {
+      // 璇勭骇鍒跺垽鏂瘑鐮佸己搴� 鏈�楂�5
+      let grade = 0;
+      if (/\d/.test(v)) {
+        grade++; //鏁板瓧
+      }
+      if (/[a-z]/.test(v)) {
+        grade++; //灏忓啓
+      }
+      if (/[A-Z]/.test(v)) {
+        grade++; //澶у啓
+      }
+      if (/\W/.test(v)) {
+        grade++; //鐗规畩瀛楃
+      }
+      if (v.length >= 8) {
+        grade++;
+      }
+      if(grade<5){
+        this.showChangePass = true;
+        this.flag++;
+        if(this.flag>1){
+          this.handleClickUserDropdown("loginout");
+        }
+        setInterval(() => {
+          this.init();
+        }, 1000*60)
+      }
+    },
     handleClickUserDropdown(name) {
       if (name == "ownSpace") {
         util.openNewPage(this, "ownspace_index");
@@ -72,13 +107,13 @@
           this.$store.commit("setLoading", false);
           if (res.result) {
             let domain = res.result.ssoDomain;
-            Cookies.set("accessToken", "", {
-              domain: domain,
-              expires: 7,
-            });
+            // Cookies.set("accessToken", "", {
+            //   domain: domain,
+            //   expires: 7,
+            // });
           }
           this.$store.commit("logout", this);
-          this.setStore("accessToken", "");
+          this.setSessionStore("accessToken", "")
           // 寮哄埗鍒锋柊椤甸潰 閲嶆柊鍔犺浇router
           location.reload();
         });
@@ -92,4 +127,4 @@
 </script>
 
 <style lang="less" scoped>
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.1