优化
This commit is contained in:
parent
89c15198a0
commit
e09d9a0d60
@ -1,6 +1,5 @@
|
|||||||
import { getDepList } from '@/api/report'
|
import { getDepList } from '@/api/report'
|
||||||
import * as dd from 'dingtalk-jsapi'
|
import { apiUserInfo } from '@/api/login'
|
||||||
import { apiDingtalkLogin, apiUserInfo } from '@/api/login'
|
|
||||||
const user = {
|
const user = {
|
||||||
state: {
|
state: {
|
||||||
deplist: [],
|
deplist: [],
|
||||||
@ -28,8 +27,10 @@ const user = {
|
|||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
commit('SET_USER_INFO', res.user)
|
commit('SET_USER_INFO', res.user)
|
||||||
commit('SET_USER_INFO', res.data)
|
commit('SET_USER_INFO', res.data)
|
||||||
|
return 1
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.msg0)
|
this.$message.error(res.msg0)
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
GET_DEPLIST: ({ commit }) => {
|
GET_DEPLIST: ({ commit }) => {
|
||||||
|
|||||||
@ -39,7 +39,10 @@ function handleGetDingtalkCode () {
|
|||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
if (!store.getters.userInfo.userNo && !dd.other) {
|
if (!store.getters.userInfo.userNo && !dd.other) {
|
||||||
let res = await handleGetDingtalkCode()
|
let res = await handleGetDingtalkCode()
|
||||||
if (res === 1) next()
|
if (res === 1) {
|
||||||
|
let res1 = await store.dispatch('GET_USERINFO')
|
||||||
|
if (res1 === 1) next()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user