master
xy 2 years ago
parent a14150f9d2
commit 6424645507

@ -25,11 +25,23 @@ router.beforeEach(async (to, from, next) => {
document.title = getPageTitle(to.meta.title) document.title = getPageTitle(to.meta.title)
if (to.query.code) { if (to.query.code) {
console.log(to)
const { token } = await loginOssV2({ const { token } = await loginOssV2({
code: to.query.code code: to.query.code
}) })
store.commit('user/SET_TOKEN',token) store.commit('user/SET_TOKEN',token)
const {
roles
} = await store.dispatch('user/getInfo')
// generate accessible routes map based on roles
const accessRoutes = await store.dispatch('permission/generateRoutes', roles)
// dynamically add accessible routes
router.addRoutes(accessRoutes)
next('/old')
return
} }
// determine whether the user has logged in // determine whether the user has logged in
const hasToken = getToken() const hasToken = getToken()

@ -286,7 +286,7 @@
type: this.select.type, type: this.select.type,
plan_department_id: this.select.department, plan_department_id: this.select.department,
//top_pid: 1, //top_pid: 1,
is_auth: 0, is_auth: 1,
is_tree: 1 is_tree: 1
}).then(res => { }).then(res => {
for (var m of res.list) { for (var m of res.list) {

Loading…
Cancel
Save