diff --git a/.vuepress/login-manager.js b/.vuepress/login-manager.js index 92f9bf7..e07f229 100644 --- a/.vuepress/login-manager.js +++ b/.vuepress/login-manager.js @@ -3,7 +3,10 @@ import Cookies from 'js-cookie' let TOKEN_KEY = 'kb-user-center-token' -let domain = window.location.hostname +let domain = '' +if (typeof window !== 'undefined') { + domain = window.location.hostname +} if (domain.indexOf('kuboard.cn') >= 0) { domain = 'kuboard.cn' } diff --git a/.vuepress/theme/components/OnlineChat.vue b/.vuepress/theme/components/OnlineChat.vue index 60a2a67..368b9f2 100644 --- a/.vuepress/theme/components/OnlineChat.vue +++ b/.vuepress/theme/components/OnlineChat.vue @@ -129,7 +129,7 @@ export default { logout () { this.showLogout = false _MEIQIA('hidePanel') - localStorage.removeItem(TOKEN_KEY) + this.$logout() } }, }