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)