From 9bd4a44ab6228405bab1686fc4c6d6cb1ebb4ae8 Mon Sep 17 00:00:00 2001 From: 2910410219 <2910410219@qq.com> Date: Thu, 28 May 2026 11:10:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=A0=B7=E5=BC=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 20 ++- src/views/home/components/ChatList.vue | 87 ---------- src/views/home/components/Sidebar.vue | 221 +------------------------ src/views/knowledge/index.vue | 7 +- 4 files changed, 20 insertions(+), 315 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 2db8659..293139b 100644 --- a/CLAUDE.md +++ b/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. diff --git a/src/views/home/components/ChatList.vue b/src/views/home/components/ChatList.vue index 0cf86ed..4d5ea89 100644 --- a/src/views/home/components/ChatList.vue +++ b/src/views/home/components/ChatList.vue @@ -3,18 +3,10 @@