Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/ROUTER_PERMISSON_UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## 2026-01-07 升级记录:路由 Key 统一与生产环境修复

### 1. 路由 Key / Path 强制统一

- **变更**:全量重构了路由配置,强制 **`key` 必须等于绝对路径 `path`**。
- **影响范围**:
- `src/config/menu.config.jsx`: 菜单配置现已完全使用 path 作为唯一标识。
Expand All @@ -15,6 +16,7 @@
- 在代码中引用路由时,请始终使用完整的绝对路径(如 `/tech/frontend`)。

### 2. 权限策略修正

- **Admin 角色**:修复了 `admin` 角色在 `mock/permission.ts` 中缺少部分新业务页面(如 `/markmap`)权限的问题。
- **路由守卫增强**:`AuthRouter` 增加了对 `matchPath` 的异常捕获,防止因路由配置不规范导致整个应用在鉴权阶段白屏崩溃。

Expand Down
3 changes: 1 addition & 2 deletions docs/build-and-bundle-optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,5 @@
- **问题**:在生产模式下,动态导入的插件可能被包装为 Module Namespace 对象(`{ default: fn, ... }`),直接作为函数调用会导致崩溃。
- **解决方案**:在使用前进行兼容性解包:
```javascript
const plugin = importedPlugin?.default || importedPlugin;
const plugin = importedPlugin?.default || importedPlugin
```

2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},

Expand Down
8 changes: 4 additions & 4 deletions src/utils/hashRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading