From a10baccaf9e77c8e627b4d0fcdd8877e0193f36b Mon Sep 17 00:00:00 2001 From: Xia Zekun Date: Thu, 30 May 2024 16:17:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83=E6=8E=92?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 08b7ad65d4291532a08932d00a8f3623131db56c) --- src/main.js | 9 +++++++-- src/store/modules/user.js | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index dce9858..b420494 100644 --- a/src/main.js +++ b/src/main.js @@ -73,13 +73,18 @@ new Vue({ mounted () { store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN)) store.commit('SET_INFO', Vue.ls.get(USER_INFO)) + console.log('new Vue()') // 判断是否有token,没有的话就直接单点登录 if (!Vue.ls.get(ACCESS_TOKEN)) { + console.log('无token信息,尝试重新登录') // 非钉钉平台 不进行钉钉单点登录 - if (dd.env.platform === 'notInDingTalk') return + if (dd.env.platform === 'notInDingTalk') { + console.log(' 非钉钉平台 不进行钉钉单点登录') + return + } console.log('store.dispatch(\'DingLogin\')') - store.dispatch('DingLogin').catch((e) => { + store.dispatch('DingLogin').then().catch((e) => { Toast(e.message) }) } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 443a6bc..b6990d3 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -178,7 +178,10 @@ const user = { commit('SET_INFO', userInfo) commit('SET_NAME', { username: userInfo.username, realname: userInfo.realname, welcome: welcome() }) commit('SET_AVATAR', userInfo.avatar) - + // 跳转 + new Vue().$router.push({ path: '/search/generalSearch' }).catch((res) => { + console.log(res) + }) resolve(response) } else { reject(response)