mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-23 07:01:23 +08:00
chore(permission store): remove deadcode
This commit is contained in:
parent
732eb1b289
commit
2c53068ec7
|
@ -30,33 +30,6 @@ export const usePermissionStore = defineStore('permission', {
|
||||||
routers: [],
|
routers: [],
|
||||||
removeRoutes: [],
|
removeRoutes: [],
|
||||||
}),
|
}),
|
||||||
getters: {
|
|
||||||
rolesMap: (state) => {
|
|
||||||
const roleMap = [];
|
|
||||||
state.routers.forEach((element, index) => {
|
|
||||||
if (element.meta) {
|
|
||||||
roleMap.push({
|
|
||||||
resourceType: element.meta.title,
|
|
||||||
subResourceList: [],
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
roleMap.push({
|
|
||||||
subResourceList: [],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
element.children.forEach((item) => {
|
|
||||||
roleMap[index].subResourceList.push({
|
|
||||||
resourceName: item.meta.title,
|
|
||||||
resourceCode: item.name,
|
|
||||||
});
|
|
||||||
if (!roleMap[index].resourceType) {
|
|
||||||
roleMap[index].resourceType = item.meta.title;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return roleMap;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
actions: {
|
actions: {
|
||||||
async initRoutes(roles: Array<unknown>) {
|
async initRoutes(roles: Array<unknown>) {
|
||||||
let accessedRouters = [];
|
let accessedRouters = [];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user