优化
This commit is contained in:
parent
89c15198a0
commit
e09d9a0d60
@ -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 }) => {
|
||||
|
||||
@ -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()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user