This commit is contained in:
2025-04-19 15:28:32 +08:00
parent c80b173e28
commit 9731d104f6
17 changed files with 796 additions and 738 deletions

View File

@@ -1,8 +1,8 @@
import {defineStore} from "pinia";
import {ref} from "vue";
import {mockRoutes1, mockRoutes2} from './mock.js';
import router from "../../router/index.js";
import generateRouter from "../../router/generateRouter.js";
import Api from "../../api/index.js";
export const useSystemStore = defineStore("SystemStore", () => {
const isRoot = ref(false);
@@ -26,8 +26,8 @@ export const useSystemStore = defineStore("SystemStore", () => {
RoutesTemp.value.length = 0;
// 请求资源 mockRoutes
const routes = generateRouter(isRoot.value ? mockRoutes2 : mockRoutes1);
RoutesTemp.value.push(...(isRoot.value ? mockRoutes2 : mockRoutes1));
const {data} = await Api.admin.getMenu();
RoutesTemp.value.push(...data);
await installRoute();
}