修改代码
This commit is contained in:
parent
fb71e4cbe8
commit
306d8b305f
11
src/App.vue
11
src/App.vue
@ -20,6 +20,11 @@ export default {
|
||||
mixins: [
|
||||
WindowResizeHandler
|
||||
],
|
||||
computed: {
|
||||
path() {
|
||||
return window.location.pathname;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.roomInvite': function (val) {
|
||||
if (val.creatorId) {
|
||||
@ -58,7 +63,7 @@ export default {
|
||||
}
|
||||
});
|
||||
|
||||
this.subscribe();
|
||||
this.$nextTick(() => { this.subscribe(); });
|
||||
},
|
||||
methods: {
|
||||
resizeHandler() {
|
||||
@ -76,13 +81,11 @@ export default {
|
||||
}
|
||||
},
|
||||
subscribe() {
|
||||
this.$nextTick(() => {
|
||||
const token = getToken();
|
||||
if (token && this.$route.path != '/404') {
|
||||
if (token && this.$route.path != '/404' && !this.path.endsWith('login')) {
|
||||
const header = { group: '', 'X-Token': token };
|
||||
this.$store.dispatch('subscribe', {header, type: getSessionStorage('project')});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -166,10 +166,6 @@ export default {
|
||||
return loginInfo[this.$route.path.split('/')[1]].title;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
document.title = loginInfo[this.project].title;
|
||||
this.loginRefresh();
|
||||
},
|
||||
created() {
|
||||
this.computedAttribute();
|
||||
if (Cookies.get(this.cookiesName) && Cookies.get(this.cookiesToken)) {
|
||||
@ -189,6 +185,10 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
document.title = loginInfo[this.project].title;
|
||||
this.loginRefresh();
|
||||
},
|
||||
methods: {
|
||||
computedAttribute() {
|
||||
if (this.project.startsWith('design')) {
|
||||
@ -198,12 +198,13 @@ export default {
|
||||
this.loginClient = 'Design';
|
||||
this.path = UrlConfig.design.prefix;
|
||||
}
|
||||
|
||||
const nowLang = LangStorage.getLang('zh');
|
||||
if (nowLang === 'zh') {
|
||||
this.lang = 'en';
|
||||
this.language = 'English';
|
||||
}
|
||||
removeToken();
|
||||
|
||||
removeToken();
|
||||
setSessionStorage('project', this.project);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user