|
|
@@ -4,6 +4,7 @@
|
|
|
import { formatMenus, toTreeData, formatTreeData } from 'ele-admin';
|
|
|
import { USER_MENUS } from '@/config/setting';
|
|
|
import { getResourcesTree } from '@/api/layout';
|
|
|
+import { getCurrentUserAuthorityDeptAPI } from '@/api/system/organization';
|
|
|
const formatRouter = (list) => {
|
|
|
let menuList = []; // menuType
|
|
|
let authorities = [];
|
|
|
@@ -78,9 +79,17 @@ export default {
|
|
|
// 设置登录用户的角色
|
|
|
setRoles(state, roles) {
|
|
|
state.roles = roles;
|
|
|
+ },
|
|
|
+ // 当前登录用户的数据权限部门数据
|
|
|
+ setAuthorityDept(state, info) {
|
|
|
+ state.authorityDept = info;
|
|
|
}
|
|
|
},
|
|
|
actions: {
|
|
|
+ async getCurrentUserAuthorityDept({ commit }) {
|
|
|
+ const info = await getCurrentUserAuthorityDeptAPI();
|
|
|
+ commit('setAuthorityDept', info);
|
|
|
+ },
|
|
|
/**
|
|
|
* 请求用户信息、权限、角色、菜单
|
|
|
*/
|