ソースを参照

fix: handRank 中 isAllEmpty(rank) 改为 meta?.rank == null

isAllEmpty 类似 lodash isEmpty,会将数字视为空值(isAllEmpty(4)→true),
导致所有静态路由的硬编码 rank 被 ascending 强制覆盖为 index+2。
改为 meta?.rank == null 只拦截 null/undefined,
保留数字 rank 原值。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
skyline 1 週間 前
コミット
1add40ef91
1 ファイル変更1 行追加1 行削除
  1. 1 1
      haha-admin-web/src/router/utils.ts

+ 1 - 1
haha-admin-web/src/router/utils.ts

@@ -32,7 +32,7 @@ import { getAsyncRoutes } from "@/api/routes";
 function handRank(routeInfo: any) {
   const { name, path, parentId, meta } = routeInfo;
   return isAllEmpty(parentId)
-    ? isAllEmpty(meta?.rank) ||
+    ? (meta?.rank == null) ||
       (meta?.rank === 0 && name !== "Home" && path !== "/")
       ? true
       : false