Pārlūkot izejas kodu

Merge branch 'master' of http://221.216.211.14:3000/GCLS/GCLS_Page_Personal

gcj 3 gadi atpakaļ
vecāks
revīzija
1b282bfbcd
2 mainītis faili ar 5 papildinājumiem un 11 dzēšanām
  1. 4 10
      src/App.vue
  2. 1 1
      src/components/common/Header.vue

+ 4 - 10
src/App.vue

@@ -23,23 +23,17 @@ export default {
     if (lang_type == "AR") {
       this.dir = "rtl";
     }
-    if(localStorage.getItem("useragent_root_type")&&localStorage.getItem("useragent_root_type")!=='true'&&!localStorage.getItem("useragent_root_close")){
-        this.userAgentTipShow = true
-    }else{
-        this.handleUserAgentRoot()
-    }
+    this.handleUserAgentRoot()
   },
   methods:{
       // 判断是否为chrome浏览器 
       handleUserAgentRoot(){
-          if(navigator.userAgent.indexOf('Chrome') > -1){
-              localStorage.setItem("useragent_root_type", true);
-          }else{
-              localStorage.setItem("useragent_root_type", false);
+          if(!sessionStorage.getItem("useragent_root_close") && navigator.userAgent.indexOf('Chrome') == -1){
+              this.userAgentTipShow = true
           }
       },
       handleClickUserAgent(){
-          localStorage.setItem("useragent_root_close", true);
+          sessionStorage.setItem("useragent_root_close", true);
           this.userAgentTipShow = false
       },
   }

+ 1 - 1
src/components/common/Header.vue

@@ -204,7 +204,7 @@ export default {
     },
     QuitLogin() {
       removeToken();
-      localStorage.removeItem("useragent_root_close");
+      sessionStorage.removeItem("useragent_root_close");
       this.userShow = false;
       this.userMessage = null;
       window.location.href = "/";