优化
This commit is contained in:
parent
c87b50cceb
commit
c32075572f
@ -28,6 +28,7 @@ function handleGetDingtalkCode () {
|
||||
async onSuccess (res) {
|
||||
console.log('result===', res)
|
||||
let result = await handleDingtalkLogin(res)
|
||||
console.log('result: ', result)
|
||||
resolve(result)
|
||||
},
|
||||
onFail (err) {
|
||||
@ -38,6 +39,7 @@ function handleGetDingtalkCode () {
|
||||
})
|
||||
}
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
console.log('store: ', store)
|
||||
if (!store.getters.userInfo.userNo && !dd.other) {
|
||||
let res = await handleGetDingtalkCode()
|
||||
console.log('res: ', res)
|
||||
|
||||
@ -49,13 +49,15 @@ export default {
|
||||
if (res.code === 200) {
|
||||
this.token = res.token
|
||||
this.$cookies.set('token', res.token, res.expire)
|
||||
let ress = await apiUserInfo()
|
||||
if (ress.code === 200) {
|
||||
this.SET_USER_INFO(ress.user)
|
||||
this.SET_USER_AUTH(ress.data)
|
||||
} else {
|
||||
this.$message.error(ress.msg0)
|
||||
}
|
||||
let xcq = await this.$store.dispatch('GET_USERINFO')
|
||||
console.log('xcq: ', xcq)
|
||||
// let ress = await apiUserInfo()
|
||||
// if (ress.code === 200) {
|
||||
// this.SET_USER_INFO(ress.user)
|
||||
// this.SET_USER_AUTH(ress.data)
|
||||
// } else {
|
||||
// this.$message.error(ress.msg0)
|
||||
// }
|
||||
// location.reload()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user