From 7ce897744a17af6ac19b38286903a1487a659596 Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Tue, 10 Mar 2026 08:17:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=A6=96=E9=A1=B5=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 5 +- .env.production | 1 + src/config/index.ts | 5 + .../work-menu.ts => config/menu.ts} | 2 +- src/pages/index/index.vue | 350 ++++++++++++++---- src/pages/work/index.vue | 4 +- src/types/auto-imports.d.ts | 5 + src/utils/request.ts | 77 ++-- 8 files changed, 334 insertions(+), 115 deletions(-) create mode 100644 src/config/index.ts rename src/{constants/work-menu.ts => config/menu.ts} (95%) diff --git a/.env.development b/.env.development index c2a791b..918c77c 100644 --- a/.env.development +++ b/.env.development @@ -7,8 +7,7 @@ VITE_APP_PORT = 4096 VITE_APP_BASE_API = '/dev-api' # API 服务器的 URL -# VITE_APP_API_URL = http://localhost:8000 -VITE_APP_API_URL = https://api.youlai.tech +VITE_APP_API_URL = http://localhost:8000 # WebSocket 服务器的 URL,不配置默认关闭 WebSocket -#VITE_APP_WS_ENDPOINT= ws://localhost:4096/ws \ No newline at end of file +#VITE_APP_WS_ENDPOINT= ws://localhost:4096/ws diff --git a/.env.production b/.env.production index 1226d8b..d4836e7 100644 --- a/.env.production +++ b/.env.production @@ -2,3 +2,4 @@ # API 基础路径,开发环境下的请求前缀 VITE_APP_BASE_API = '/prod-api' +VITE_APP_API_URL = https://api.youlai.tech diff --git a/src/config/index.ts b/src/config/index.ts new file mode 100644 index 0000000..235662f --- /dev/null +++ b/src/config/index.ts @@ -0,0 +1,5 @@ +/** + * 配置统一导出 + */ + +export * from "./menu"; diff --git a/src/constants/work-menu.ts b/src/config/menu.ts similarity index 95% rename from src/constants/work-menu.ts rename to src/config/menu.ts index 868aee7..59b257e 100644 --- a/src/constants/work-menu.ts +++ b/src/config/menu.ts @@ -14,7 +14,7 @@ export interface WorkMenuGroup { children: WorkMenuItem[]; } -export const workMenuConfig: WorkMenuGroup[] = [ +export const menuConfig: WorkMenuGroup[] = [ { title: "系统管理", children: [ diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 866964e..f2ae210 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -31,59 +31,59 @@ - - - + + + + + + {{ noticeText || "暂无通知公告" }} + + - - - - - - - - 访客数 - {{ visitStatsData.todayUvCount }} - - - - - - 浏览量 - {{ visitStatsData.todayPvCount }} - - - - - - 版本 - {{ appVersion }} - + + 访客数 + + + {{ visitStatsData.todayUvCount }} + - + + + + + + 浏览量 + + + + {{ visitStatsData.todayPvCount }} + + + + + + + + 应用版本 + + + {{ appVersion }} + + - +