Files
2026-03-21 22:47:42 +08:00

1.1 KiB

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/)
  • Two-layer route guard: user login check + permission check

Dynamic Route System

  • Server menu fetched in app store via fetchServerMenuConfig()
  • Routes registered dynamically in permission.ts
  • Uses isMenuLoading/isMenuLoaded flags to prevent duplicate loads

API Architecture

  • Two axios instances for different auth patterns:
  • Choose based on backend API requirements

State Management

  • SafeStorage required for all localStorage access
  • Supports TTL expiry and type-safe keys via enum

Component Patterns

  • Global components registered in components/index.ts
  • ECharts modules manually imported for bundle size optimization