This commit is contained in:
2026-05-02 09:59:06 +08:00
parent ea3e60c17c
commit 1af4075e9b
249 changed files with 11209 additions and 14884 deletions

View File

@@ -1,25 +1,30 @@
# Architect Mode Rules (Non-Obvious Only)
## Architecture Overview
- Vue 3 SPA with dynamic route loading from server
- Pinia stores: `app`, `user`, `tab-bar` (see [`src/store/`](src/store/))
- Two-layer route guard: user login check + permission check
## Dynamic Route System
- Server menu fetched in [`app store`](src/store/modules/app/index.ts) via `fetchServerMenuConfig()`
- Routes registered dynamically in [`permission.ts`](src/router/guard/permission.ts)
- Uses `isMenuLoading`/`isMenuLoaded` flags to prevent duplicate loads
## API Architecture
- Two axios instances for different auth patterns:
- [`request.ts`](src/api/request.ts): Workspace header + custom token format
- [`interceptor.ts`](src/api/interceptor.ts): Bearer token + code 20000 validation
- Choose based on backend API requirements
## State Management
- [`SafeStorage`](src/utils/safeStorage.ts) required for all localStorage access
- Supports TTL expiry and type-safe keys via enum
## Component Patterns
- Global components registered in [`components/index.ts`](src/components/index.ts)
- ECharts modules manually imported for bundle size optimization
- ECharts modules manually imported for bundle size optimization