This commit is contained in:
熊成强 2020-11-18 15:52:44 +08:00
parent c87b50cceb
commit c32075572f
2 changed files with 11 additions and 7 deletions

View File

@ -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)

View File

@ -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)