From d70bfb53dd5d92d0405f7ce3d2c9bbabce26184b Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期一, 20 五月 2024 11:37:07 +0800
Subject: [PATCH] 修复兼容zlm-pro转码时无人管看自动移除失败的BUG
---
web_src/src/App.vue | 44 +++++++++++++++++---------------------------
1 files changed, 17 insertions(+), 27 deletions(-)
diff --git a/web_src/src/App.vue b/web_src/src/App.vue
old mode 100644
new mode 100755
index 4ae7ea8..103cbe1
--- a/web_src/src/App.vue
+++ b/web_src/src/App.vue
@@ -5,11 +5,13 @@
</template>
<script>
+import userService from './components/service/UserService'
export default {
name: 'app',
data(){
return {
isLogin: false,
+ excludeLoginCheck: ["/play/wasm", "/play/rtc"],
userInfo: { //淇濆瓨鐢ㄦ埛淇℃伅
nick: null,
ulevel: null,
@@ -19,42 +21,30 @@
}
},
created() {
- if(!this.$cookies.get("session")){
+ 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: {
- //璇锋眰鐢ㄦ埛鐨勪竴浜涗俊鎭�
- getUserInfo(){
- var userinfo = this.$cookies.get("session");
- },
- checkLogin(){
- //妫�鏌ユ槸鍚﹀瓨鍦╯ession
- //cookie鎿嶄綔鏂规硶鍦ㄦ簮鐮侀噷鏈夋垨鑰呭弬鑰冪綉涓婄殑鍗冲彲
- if(!this.$cookies.get("session")){
- //濡傛灉娌℃湁鐧诲綍鐘舵�佸垯璺宠浆鍒扮櫥褰曢〉
- this.$router.push('/login');
- }
- },
- getCookie: function (cname) {
- var name = cname + "=";
- var ca = document.cookie.split(';');
- for (var i = 0; i < ca.length; i++) {
- var c = ca[i];
- while (c.charAt(0) == ' ') c = c.substring(1);
- if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
- }
- return "";
- }
},
components: {}
};
--
Gitblit v1.8.0