Browse Source

浏览器判断

natasha 3 years ago
parent
commit
24087d13b2
1 changed files with 3 additions and 9 deletions
  1. 3 9
      src/App.vue

+ 3 - 9
src/App.vue

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