This commit is contained in:
熊成强 2020-11-16 17:17:22 +08:00
parent 89c15198a0
commit e09d9a0d60
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,5 @@
import { getDepList } from '@/api/report'
import * as dd from 'dingtalk-jsapi'
import { apiDingtalkLogin, apiUserInfo } from '@/api/login'
import { apiUserInfo } from '@/api/login'
const user = {
state: {
deplist: [],
@ -28,8 +27,10 @@ const user = {
if (res.code === 200) {
commit('SET_USER_INFO', res.user)
commit('SET_USER_INFO', res.data)
return 1
} else {
this.$message.error(res.msg0)
return 0
}
},
GET_DEPLIST: ({ commit }) => {

View File

@ -39,7 +39,10 @@ function handleGetDingtalkCode () {
router.beforeEach(async (to, from, next) => {
if (!store.getters.userInfo.userNo && !dd.other) {
let res = await handleGetDingtalkCode()
if (res === 1) next()
if (res === 1) {
let res1 = await store.dispatch('GET_USERINFO')
if (res1 === 1) next()
}
} else {
next()
}