tongshangming 2 anni fa
parent
commit
f33f3daed5
2 ha cambiato i file con 18 aggiunte e 13 eliminazioni
  1. 12 12
      pnpm-lock.yaml
  2. 6 1
      src/stores/router.ts

+ 12 - 12
pnpm-lock.yaml

@@ -5,7 +5,7 @@ specifiers:
   '@icon-park/vue-next': ^1.4.2
   '@iconify-json/ep': ^1.1.8
   '@rushstack/eslint-patch': ^1.2.0
-  '@types/node': ^16.18.10
+  '@types/node': ^16.18.3
   '@types/nprogress': ^0.2.0
   '@types/qs': ^6.9.7
   '@vitejs/plugin-vue': ^3.2.0
@@ -13,24 +13,24 @@ specifiers:
   '@vue/eslint-config-prettier': ^7.0.0
   '@vue/eslint-config-typescript': ^11.0.2
   '@vue/tsconfig': ^0.1.3
-  '@vueuse/core': ^9.8.2
+  '@vueuse/core': ^9.5.0
   '@wangeditor/editor': ^5.1.23
   '@wangeditor/editor-for-vue': ^5.1.12
   axios: ^1.2.1
   dayjs: ^1.11.7
-  element-plus: ^2.2.27
-  eslint: ^8.30.0
-  eslint-plugin-vue: ^9.8.0
+  element-plus: ^2.2.21
+  eslint: ^8.27.0
+  eslint-plugin-vue: ^9.7.0
   npm-run-all: ^4.1.5
   nprogress: ^0.2.0
-  pinia: ^2.0.28
-  prettier: ^2.8.1
-  sass: ^1.57.1
+  pinia: ^2.0.23
+  prettier: ^2.7.1
+  sass: ^1.56.1
   typescript: ~4.7.4
   unocss: ^0.46.5
-  unplugin-auto-import: ^0.11.5
-  unplugin-icons: ^0.14.15
-  unplugin-vue-components: ^0.22.12
+  unplugin-auto-import: ^0.11.4
+  unplugin-icons: ^0.14.13
+  unplugin-vue-components: ^0.22.9
   unplugin-vue-define-options: ^0.11.2
   vite: ^4.0.3
   vite-plugin-style-import: ^2.0.0
@@ -38,7 +38,7 @@ specifiers:
   vue: ^3.2.45
   vue-router: ^4.1.6
   vue-tsc: ^0.39.5
-  vxe-table: ^4.3.7
+  vxe-table: ^4.3.6
   xe-utils: ^3.5.7
 
 dependencies:

+ 6 - 1
src/stores/router.ts

@@ -64,15 +64,20 @@ export const useRouterStore = defineStore({
   id: 'router',
   state: () => ({
     menuRouter: <any>[],
-    asyncRouter: <any>[]
+    asyncRouter: <any>[],
+    dynamicRouter: <any>[]
   }),
   actions: {
     generatorRouter(role?: any[]): Promise<RouteRecordRaw[]> {
       return new Promise(resolve => {
         this.asyncRouter = role ? filterAsyncRouter(asyncRouter, role) : asyncRouter
+        // this.asyncRouter = generatorDynamicRouter(this.dynamicRouter)
         this.menuRouter = filterMenuRouter(this.asyncRouter)
         resolve(this.asyncRouter)
       })
+    },
+    setDynamicRouter(router: any[]) {
+      this.dynamicRouter = router
     }
   }
 })