| | |
| | | // import { RouteConfigs } from "@/layout/types"; |
| | | import { constantRoutes, Route } from '@/router'; |
| | | import { addAsyncRoutes, ascending } from '@/router/utils'; |
| | | import * as baseModuleServices from '@/services/api/BaseModule'; |
| | | |
| | | export interface PermissonState { |
| | | routes: Route[]; |
| | |
| | | getModuleList() { |
| | | return new Promise<Route[]>(async (resolve, reject) => { |
| | | try { |
| | | // let res = await userApiClient.apiUserUserMenusGet(); |
| | | // let userMenuList = res.data.data; |
| | | // let userInfo = rootGetters['userInfo'] as Getter['userInfo']; |
| | | const res = await baseModuleServices.getCurrentUserModuleList({ |
| | | showLoading: false, |
| | | }); |
| | | // const res = await baseModuleServices.getCurrentUserModuleList({ |
| | | // showLoading: false, |
| | | // }); |
| | | const res = []; |
| | | const accessedRoutes = ascending(addAsyncRoutes(formatModuleList(res, null))); // createAccessedRoutes(userMenuList, userInfo) |
| | | //@ts-ignore |
| | | accessedRoutes.push({ path: '/:pathMatch(.*)*', redirect: '/404', hidden: true }); |