Browse Source

地大短信验证

Michael Wang 6 years ago
parent
commit
6541579e37
2 changed files with 8 additions and 5 deletions
  1. 7 5
      src/features/OnlineExam/PhoneVerifyForDD.vue
  2. 1 0
      src/main.js

+ 7 - 5
src/features/OnlineExam/PhoneVerifyForDD.vue

@@ -31,7 +31,12 @@ export default {
     };
   },
   async mounted() {
-    if (["cugr.ecs.qmth.com.cn"].includes(localStorage.getItem("domain"))) {
+    if (
+      ["cugr.ecs.qmth.com.cn", "test.qmth.com.cn"].includes(
+        localStorage.getItem("domain")
+      ) &&
+      !localStorage.getItem("phoneVerified")
+    ) {
       this.phoneModal = true;
     }
   },
@@ -61,10 +66,7 @@ export default {
         );
         if (res.data.success) {
           this.phoneModal = false;
-          localStorage.setItem(
-            "phoneVerified:" + this.user.phoneNumber,
-            "true"
-          );
+          localStorage.setItem("phoneVerified", "true");
         } else {
           this.$Message.error(res.data.returnMsg);
         }

+ 1 - 0
src/main.js

@@ -86,6 +86,7 @@ Vue.mixin({
   },
   methods: {
     logout() {
+      localStorage.removeItem("phoneVerified");
       this.$router.push("/login/" + localStorage.getItem("domain"));
     }
   }