首页样式优化
This commit is contained in:
20
CLAUDE.md
20
CLAUDE.md
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
|
||||
## Project Overview
|
||||
|
||||
This is the GFast UI project, a Vue 3 admin management system based on the vue-next-admin template, customized for a digital advertising/trading platform.
|
||||
This is the **GFast UI** project (`gfast-ui`), a Vue 3 admin management system based on the vue-next-admin template, customized for a digital advertising/trading platform.
|
||||
|
||||
## Commands
|
||||
|
||||
@@ -60,11 +60,14 @@ This is the GFast UI project, a Vue 3 admin management system based on the vue-n
|
||||
|
||||
2. **API Requests**:
|
||||
- API methods are organized by domain in `src/api/` (each subdomain has its own directory structure)
|
||||
- The Axios instance in `src/utils/request.ts` automatically:
|
||||
- Adds Bearer token from session storage
|
||||
- Sends only changed fields for PUT requests (diff comparison with original data)
|
||||
- Handles token expiration globally with redirect to login
|
||||
- The Axios instance in `src/utils/request.ts` is pre-configured with:
|
||||
- 50 second request timeout
|
||||
- `qs` serialization of query parameters with dot notation for nested objects
|
||||
- Automatically adds Bearer token (from cookies via Session utility) to all requests
|
||||
- Automatically sends only changed fields for PUT requests (diff comparison with original data via `_originalData` field)
|
||||
- Handles token expiration globally with redirect to login (prevents multiple overlapping popups)
|
||||
- Provides error message extraction from multiple response formats (`message`, `msg`, `error`, `detail`)
|
||||
- Error throttling: maximum one error message every 2 seconds
|
||||
- Supports error mode configuration via `requestOptions.errorMode`:
|
||||
- `global`: (default) Global error popup with backend message
|
||||
- `page`: No automatic popup, reject the error for page-level handling
|
||||
@@ -78,9 +81,14 @@ This is the GFast UI project, a Vue 3 admin management system based on the vue-n
|
||||
- `getUpFileUrl`, `handleTree`, `useDict`, `selectDictLabel`, `parseTime`, `getItems`, `setItems`, `getOptionValue`, `isEmpty`
|
||||
- Global components:
|
||||
- `pagination` - Reusable pagination component
|
||||
- Global plugins registered:
|
||||
- `vue-simple-uploader` - Large file upload component
|
||||
- Global event bus via mitt: `app.config.globalProperties.mittBus`
|
||||
|
||||
4. **Authentication**: Token is stored in session storage via the `Session` utility. 401 responses (HTTP or business code) trigger automatic logout.
|
||||
4. **Authentication**:
|
||||
- Token is stored in cookies via `js-cookie` (through the `Session` utility). Other user session data is stored in `sessionStorage`.
|
||||
- The `Session.clearAuth()` method only clears authentication-related keys (`token`, `userInfo`, `userMenu`, `permissions`), preserving other local preferences.
|
||||
- 401 responses (HTTP or business code) containing token expiration signals trigger automatic logout with a single confirmation popup.
|
||||
|
||||
5. **Keep-alive**: Route components can be cached via keep-alive, managed by the `useKeepALiveNames` store.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user