This commit is contained in:
熊成强 2020-11-20 14:23:07 +08:00
parent c93148bc4d
commit 164daf9bf3
3 changed files with 8 additions and 10 deletions

View File

@ -46,8 +46,9 @@ export default {
// await this.handleDingtalkLogin() // await this.handleDingtalkLogin()
} }
}, },
mounted () { async mounted () {
this.GET_DEPLIST() const a = await this.GET_DEPLIST()
console.log('a: ', a)
}, },
methods: { methods: {
onCancel () { onCancel () {

View File

@ -37,13 +37,10 @@ const user = {
return 0 return 0
} }
}, },
GET_DEPLIST: ({ commit }) => { GET_DEPLIST: async ({ commit }) => {
getDepList({type: 1}).then(response => { let data = getDepList({type: 1})
const data = response.code === 200 ? response.data : [] commit('SET_DEPLIST', data.code === 200 ? data.data : [])
commit('SET_DEPLIST', data) return data
}).catch(error => {
console.log(error)
})
} }
} }
} }

View File

@ -38,7 +38,7 @@ function handleGetDingtalkCode () {
}) })
} }
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
console.log('dd: ', dd) console.log('dd---: ', dd)
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)