소스 검색

浏览器提示

natasha 3 년 전
부모
커밋
fcc7ddf80e
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      src/App.vue
  2. 1 1
      src/components/login/LoginNav.vue

+ 2 - 2
src/App.vue

@@ -28,12 +28,12 @@ export default {
   methods:{
       // 判断是否为chrome浏览器 
       handleUserAgentRoot(){
-          if(!localStorage.getItem("useragent_root_close") && navigator.userAgent.indexOf('Chrome') == -1){
+          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/login/LoginNav.vue

@@ -226,7 +226,7 @@ export default {
       Cookies.remove("session_id");
       Cookies.remove("user_code");
       Cookies.remove("user_type");
-      localStorage.removeItem("useragent_root_close");
+      sessionStorage.removeItem("useragent_root_close");
       removeToken();
       this.userShow = false;
       this.userMessage = null;