提交 e13f4567 authored 作者: matian's avatar matian

Merge remote-tracking branch 'origin/master'

......@@ -8,6 +8,7 @@ Vue.use(Vuex)
const store = new Vuex.Store({
state: {
user: {},
role: {},
permissions: [],
appConfig: {},
appConfigList
......@@ -19,6 +20,9 @@ const store = new Vuex.Store({
setPermissions(state, permissions) {
state.permissions = permissions
},
setRole(state, role) {
state.role = role
},
setAppConfig(state, appConfig) {
state.appConfig = appConfig
localStorage.setItem('app_config', JSON.stringify(appConfig))
......@@ -61,6 +65,7 @@ const store = new Vuex.Store({
await getPermissions().then(res => {
if (res.data && res.data.items) {
commit('setPermissions', res.data.items)
commit('setRole', res.data.organization.role)
}
})
},
......
......@@ -31,5 +31,12 @@ export default async function (to, from, next) {
return
}
// BFI机构管理员
const role = store.state.role
if (role.id === '70033365707403264' && !to.path.includes('bfi')) {
next('/bfi/cert')
return
}
next()
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论