浏览代码

chore: 默认关闭 `CachingAsyncRoutes` 动态路由缓存本地,可自行开启

xiaoxian521 2 年之前
父节点
当前提交
1081506d10
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 1
      public/serverConfig.json
  2. 2 1
      src/views/permission/page/index.vue

+ 1 - 1
public/serverConfig.json

@@ -17,7 +17,7 @@
   "ShowLogo": true,
   "ShowModel": "smart",
   "MenuArrowIconNoTransition": true,
-  "CachingAsyncRoutes": true,
+  "CachingAsyncRoutes": false,
   "TooltipEffect": "light",
   "MapConfigure": {
     "amapKey": "97b3248d1553172e81f168cf94ea667e",

+ 2 - 1
src/views/permission/page/index.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
 import { initRouter } from "@/router/utils";
+import { storageSession } from "@pureadmin/utils";
 import { type CSSProperties, ref, computed } from "vue";
 import { useUserStoreHook } from "@/store/modules/user";
 import { usePermissionStoreHook } from "@/store/modules/permission";
@@ -33,7 +34,7 @@ function onChange() {
     .loginByUsername({ username: username.value, password: "admin123" })
     .then(res => {
       if (res.success) {
-        sessionStorage.removeItem("async-routes");
+        storageSession().removeItem("async-routes");
         usePermissionStoreHook().clearAllCachePage();
         initRouter();
       }