diff --git a/docs/ROUTER_PERMISSON_UPGRADE.md b/docs/ROUTER_PERMISSON_UPGRADE.md index 9beaa546..9ec05df3 100644 --- a/docs/ROUTER_PERMISSON_UPGRADE.md +++ b/docs/ROUTER_PERMISSON_UPGRADE.md @@ -5,6 +5,7 @@ ## 2026-01-07 升级记录:路由 Key 统一与生产环境修复 ### 1. 路由 Key / Path 强制统一 + - **变更**:全量重构了路由配置,强制 **`key` 必须等于绝对路径 `path`**。 - **影响范围**: - `src/config/menu.config.jsx`: 菜单配置现已完全使用 path 作为唯一标识。 @@ -15,6 +16,7 @@ - 在代码中引用路由时,请始终使用完整的绝对路径(如 `/tech/frontend`)。 ### 2. 权限策略修正 + - **Admin 角色**:修复了 `admin` 角色在 `mock/permission.ts` 中缺少部分新业务页面(如 `/markmap`)权限的问题。 - **路由守卫增强**:`AuthRouter` 增加了对 `matchPath` 的异常捕获,防止因路由配置不规范导致整个应用在鉴权阶段白屏崩溃。 diff --git a/docs/build-and-bundle-optimizations.md b/docs/build-and-bundle-optimizations.md index efc3eb39..b38ee65f 100644 --- a/docs/build-and-bundle-optimizations.md +++ b/docs/build-and-bundle-optimizations.md @@ -91,6 +91,5 @@ - **问题**:在生产模式下,动态导入的插件可能被包装为 Module Namespace 对象(`{ default: fn, ... }`),直接作为函数调用会导致崩溃。 - **解决方案**:在使用前进行兼容性解包: ```javascript - const plugin = importedPlugin?.default || importedPlugin; + const plugin = importedPlugin?.default || importedPlugin ``` - diff --git a/eslint.config.js b/eslint.config.js index 63ea5581..ffc0f69c 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -84,7 +84,7 @@ export default [ // avoid hard failure on empty blocks 'no-empty': 'warn', - 'no-unused-disable-directive': 'off' + 'no-unused-disable-directive': 'off', }, }, diff --git a/src/utils/hashRouter.ts b/src/utils/hashRouter.ts index 6d8e884c..359ab623 100644 --- a/src/utils/hashRouter.ts +++ b/src/utils/hashRouter.ts @@ -23,13 +23,13 @@ export class HashRouterUtils { g[key] += 1 // 尽量输出可读信息,同时给出调用栈 - + console.groupCollapsed(`[DEBUG_NAV_TO] non-string to/path from ${source}`) - + console.log('value:', value) - + console.trace('stack') - + console.groupEnd() } catch { // ignore