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