mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-11-10 06:58: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: [],
|
||||
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: {
|
||||
async initRoutes(roles: Array<unknown>) {
|
||||
let accessedRouters = [];
|
||||
|
|
Loading…
Reference in New Issue
Block a user