mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-23 02:56:35 +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