From 0ee5444ede26cad32895cdc2ec094cc33b13b591 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Tue, 13 Oct 2026 14:37:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=90=8E=E5=8F=B0=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=87=8D=E6=8E=92=E6=88=90=E7=BD=91?= =?UTF-8?q?=E7=AB=99=E3=80=81=E7=8F=AD=E7=BA=A7=E3=80=81=E5=BC=80=E5=85=B3?= =?UTF-8?q?=E3=80=81=E5=88=A4=E9=A2=98=E6=9C=BA=E5=87=A0=E5=9D=97=EF=BC=8C?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E6=8C=AA=E5=88=B0=E5=8F=B3=E4=B8=8A=E8=A7=92?= =?UTF-8?q?=EF=BC=9B=E7=8F=AD=E7=BA=A7=E6=8C=89=E5=B9=B4=E7=BA=A7=E5=88=86?= =?UTF-8?q?=E7=BB=84=E4=B8=8D=E7=94=A8=E5=86=8D=E6=8B=96=EF=BC=9B=E5=88=A4?= =?UTF-8?q?=E9=A2=98=E6=9C=BA=E5=86=99=E5=87=BA=E5=A4=9A=E4=B9=85=E6=B2=A1?= =?UTF-8?q?=E5=8A=A8=E9=9D=99=EF=BC=9BAI=20=E5=B0=8F=E5=8A=A9=E6=89=8B?= =?UTF-8?q?=EF=BC=88MaxKB=20=E6=8C=82=E4=BB=B6=EF=BC=89=E6=95=B4=E4=B8=AA?= =?UTF-8?q?=E5=88=A0=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- apps/web/.env.production | 1 - apps/web/.env.staging | 1 - apps/web/.env.test | 1 - apps/web/CLAUDE.md | 3 +- apps/web/index.html | 3 - apps/web/src/App.vue | 7 +- apps/web/src/admin/setting/config.vue | 543 ++++++++++++++------------ apps/web/src/env.d.ts | 1 - apps/web/src/shared/store/config.ts | 7 - apps/web/vite.config.ts | 10 - 10 files changed, 304 insertions(+), 273 deletions(-) diff --git a/apps/web/.env.production b/apps/web/.env.production index b6913ab..a241ae7 100644 --- a/apps/web/.env.production +++ b/apps/web/.env.production @@ -1,4 +1,3 @@ PUBLIC_ENV=xuyue.cc -PUBLIC_MAXKB_URL=https://maxkb.xuyue.cc/chat/api/embed?protocol=https&host=maxkb.xuyue.cc&token=dd37457027c40b39 PUBLIC_CODE_URL=https://code.xuyue.cc PUBLIC_ICONIFY_URL=https://icon.xuyue.cc \ No newline at end of file diff --git a/apps/web/.env.staging b/apps/web/.env.staging index a913ce6..190af53 100644 --- a/apps/web/.env.staging +++ b/apps/web/.env.staging @@ -1,4 +1,3 @@ PUBLIC_ENV=school -PUBLIC_MAXKB_URL=http://10.13.114.114:92/chat/api/embed?protocol=http&host=10.13.114.114:92&token=dd37457027c40b39 PUBLIC_CODE_URL=http://10.13.114.114:82 PUBLIC_ICONIFY_URL=http://10.13.114.114:8098 diff --git a/apps/web/.env.test b/apps/web/.env.test index 38e91cf..dd12c88 100644 --- a/apps/web/.env.test +++ b/apps/web/.env.test @@ -1,4 +1,3 @@ PUBLIC_ENV=test -PUBLIC_MAXKB_URL=http://10.13.114.114:92/chat/api/embed?protocol=http&host=10.13.114.114:92&token=dd37457027c40b39 PUBLIC_CODE_URL=http://10.13.114.114:82 PUBLIC_ICONIFY_URL=http://10.13.114.114:8098 diff --git a/apps/web/CLAUDE.md b/apps/web/CLAUDE.md index 4dcef82..5213ee9 100644 --- a/apps/web/CLAUDE.md +++ b/apps/web/CLAUDE.md @@ -59,7 +59,7 @@ API 调用不按模块分:学生端全在 `oj/api.ts`、后台全在 `admin/ap Shared logic lives in `shared/`: - `store/` — Pinia stores: `user` (auth/roles), `config` (site-wide settings), `authModal` (login/signup form state), `collab` (help-request queue + collab room), `achievement` (解锁弹窗队列), `myFlowchart` (题面「你画的流程图」那张 A/S 图的 mermaid 源码) -- `composables/` — `aiStream`, `pagination` (URL-synced), `websocket` (reconnect + heartbeat), `collabDoc` (Yjs binding for the collab channel), `configUpdate` (WS-pushed config sync), `useMermaid` (lazy Mermaid render), `darkTransition` (View Transitions,111 以下走降级分支), `leaveStudents` (课堂看板的「请假」), `chartTheme`, `breakpoints`, `maxkb`, `rarity` +- `composables/` — `aiStream`, `pagination` (URL-synced), `websocket` (reconnect + heartbeat), `collabDoc` (Yjs binding for the collab channel), `configUpdate` (WS-pushed config sync), `useMermaid` (lazy Mermaid render), `darkTransition` (View Transitions,111 以下走降级分支), `leaveStudents` (课堂看板的「请假」), `chartTheme`, `breakpoints`, `rarity` - `layout/` — `default.vue` and `admin.vue` layout wrappers - `api.ts` — shared API calls (auth, profile, tags, captcha) @@ -168,7 +168,6 @@ Env files: `.env`(本机)、`.env.production`(服务器)、`.env.staging |---|---| | `PUBLIC_ENV` | 环境角标:`test` → 「测试版」,`dev` → 「开发版」,其余不显示 | | `PUBLIC_CODE_URL` | 代码分享服务(提交详情、题目页的「分享」) | -| `PUBLIC_MAXKB_URL` | 知识库问答挂件 | | `PUBLIC_ICONIFY_URL` | 自建 Iconify 图标源,不设则走公共 CDN | 后端地址**不在这里**:`utils/api.ts` 写死 `baseURL: "/api"`,dev 由 `vite.config.ts` 的 diff --git a/apps/web/index.html b/apps/web/index.html index 3737e63..1be5500 100644 --- a/apps/web/index.html +++ b/apps/web/index.html @@ -6,9 +6,6 @@ 判题狗 -
diff --git a/apps/web/src/App.vue b/apps/web/src/App.vue index 9a6ac7f..ce96930 100644 --- a/apps/web/src/App.vue +++ b/apps/web/src/App.vue @@ -4,7 +4,6 @@ import "normalize.css" import "./index.css" import { useConfigStore } from "shared/store/config" import { useConfigUpdate } from "shared/composables/configUpdate" -import { useMaxKB } from "shared/composables/maxkb" import { useUserStore } from "shared/store/user" import { useCollabStore } from "shared/store/collab" import CollabHost from "shared/components/CollabHost.vue" @@ -20,11 +19,9 @@ onMounted(() => { userStore.getMyProfile() }) -// 配置实时推送 + MaxKB 挂件。阶段 2 时因为后端还没有 /ws/config 而暂时关掉, -// 阶段 3 迁完之后一直没接回来 —— 表现是管理员改站点配置后学生要刷新才生效、 -// 知识库挂件根本不出现,且没有任何报错。两者现在都走新后端的 /ws/config。 +// 配置实时推送。阶段 2 时因为后端还没有 /ws/config 而暂时关掉,阶段 3 迁完之后一直 +// 没接回来 —— 表现是管理员改站点配置后学生要刷新才生效,且没有任何报错。现在走新后端的 /ws/config。 useConfigUpdate() -useMaxKB() // 课堂求助通道。和 /ws/config 一样是全局常驻的:老师可能正在后台改题时 // 收到求助,学生也要在排队期间一直挂着,所以不放在题目页里起落。 diff --git a/apps/web/src/admin/setting/config.vue b/apps/web/src/admin/setting/config.vue index a9d57bf..78a1f15 100644 --- a/apps/web/src/admin/setting/config.vue +++ b/apps/web/src/admin/setting/config.vue @@ -1,9 +1,10 @@