From 3571ca272b5c4d0b9df0d3e2c99f0384ba203797 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期日, 02 七月 2023 12:42:05 +0800
Subject: [PATCH] Merge branch 'wvp-28181-2.0' into main-dev

---
 web_src/src/App.vue |   27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/web_src/src/App.vue b/web_src/src/App.vue
index e7d45b7..103cbe1 100644
--- a/web_src/src/App.vue
+++ b/web_src/src/App.vue
@@ -11,6 +11,7 @@
   data(){
     return {
       isLogin: false,
+      excludeLoginCheck: ["/play/wasm", "/play/rtc"],
       userInfo: { //淇濆瓨鐢ㄦ埛淇℃伅
         nick: null,
         ulevel: null,
@@ -21,27 +22,29 @@
   },
   created() {
     if (userService.getToken() == null){
+      console.log(22222)
+      console.log(this.$route.path)
+      try {
+        if (this.excludeLoginCheck && this.excludeLoginCheck.length > 0) {
+          for (let i = 0; i < this.excludeLoginCheck.length; i++) {
+            if (this.$route.path.startsWith(this.excludeLoginCheck[i])){
+              return;
+            }
+          }
+        }
+      }catch (e) {
+        console.error(e)
+      }
       //濡傛灉娌℃湁鐧诲綍鐘舵�佸垯璺宠浆鍒扮櫥褰曢〉
       this.$router.push('/login');
     }
   },
-  //鐩戝惉璺敱妫�鏌ョ櫥褰�
-  watch:{
-    "$route" : 'checkLogin'
-  },
+
   mounted(){
     //缁勪欢寮�濮嬫寕杞芥椂鑾峰彇鐢ㄦ埛淇℃伅
     // this.getUserInfo();
   },
   methods: {
-    checkLogin(){
-      //妫�鏌ユ槸鍚﹀瓨鍦╯ession
-      if (userService.getToken() == null){
-        //濡傛灉娌℃湁鐧诲綍鐘舵�佸垯璺宠浆鍒扮櫥褰曢〉
-        // this.$router.push('/login');
-      }
-
-    },
   },
   components: {}
 };

--
Gitblit v1.8.0