| | |
| | | import pinia from '/@/stores/index'; |
| | | import { useUserInfo } from '/@/stores/userInfo'; |
| | | import { useRequestOldRoutes } from '/@/stores/requestOldRoutes'; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { NextLoading } from '/@/utils/loading'; |
| | | import { dynamicRoutes, notFoundAndNoPower } from '/@/router/route'; |
| | | import { formatTwoStageRoutes, formatFlatteningRoutes, router } from '/@/router/index'; |
| | |
| | | import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes'; |
| | | import { useMenuApi } from '/@/api/systemManage/menu/index'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import Cookies from 'js-cookie'; |
| | | |
| | | const menuApi = useMenuApi(); |
| | | |
| | |
| | | |
| | | export async function initBackEndControlRoutes() { |
| | | if (window.nextLoading === undefined) NextLoading.start(); |
| | | if (!Session.get('token')) return false; |
| | | const res = await getBackEndControlRoutes(Session.get('projectId') === null ? '' : Session.get('projectId')); |
| | | if (!Cookies.get('token')) return false; |
| | | const res = await getBackEndControlRoutes(Cookies.get('projectId') === null ? '' : Cookies.get('projectId')); |
| | | await useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data.data))); |
| | | dynamicRoutes[0].children = await backEndComponent(res.data.data); |
| | | await setAddRoute(); |
| | |
| | | /** |
| | | * 重新请求后端路由菜单接口 |
| | | * @description 用于菜单管理界面刷新菜单(未进行测试) |
| | | * @description 路径:/src/views/system/homeMenu/component/menuDialog.vue |
| | | * @description 路径:/src/views/system/homeMenu/components/menuDialog.vue |
| | | */ |
| | | export function setBackEndControlRefreshRoutes() { |
| | | getBackEndControlRoutes(Session.get('projectId')); |
| | | getBackEndControlRoutes(Cookies.get('projectId')); |
| | | } |
| | | |
| | | export function backEndComponent(routes: any) { |