From 752183031cc2d7b85f797d3ade4d98dd88e37881 Mon Sep 17 00:00:00 2001 From: Nixevol Date: Wed, 18 Nov 2026 10:32:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=B4=E6=98=8E=E9=A1=B5=E5=8F=AA?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E5=A4=8D=E5=88=B6=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/euniv/api.py | 6 +++--- backend/tests/test_api.py | 4 ++-- web/src/App.vue | 8 ++++---- .../ToolUpgradeView.vue} | 12 ++++++------ web/src/styles.css | 16 ++++++++-------- 5 files changed, 23 insertions(+), 23 deletions(-) rename web/src/features/{notice/NoticeView.vue => tool-upgrade/ToolUpgradeView.vue} (76%) diff --git a/backend/euniv/api.py b/backend/euniv/api.py index c97993a..a4e0963 100644 --- a/backend/euniv/api.py +++ b/backend/euniv/api.py @@ -676,9 +676,9 @@ class _WebFiles(StaticFiles): _dist = Path(__file__).resolve().parents[2] / "web" / "dist" -@app.get("/msg01", include_in_schema=False) -@app.get("/msg01/", include_in_schema=False) -def notice_page() -> FileResponse: +@app.get("/tool-upgrade", include_in_schema=False) +@app.get("/tool-upgrade/", include_in_schema=False) +def tool_upgrade_page() -> FileResponse: index = _dist / "index.html" if not index.is_file(): raise HTTPException(status_code=404, detail="页面不存在") diff --git a/backend/tests/test_api.py b/backend/tests/test_api.py index f7b903a..e606aa7 100644 --- a/backend/tests/test_api.py +++ b/backend/tests/test_api.py @@ -1222,10 +1222,10 @@ def test_exam_list_rejects_unrecognized_page() -> None: client.my_exams() -def test_notice_page_is_reachable_only_by_its_address() -> None: +def test_tool_upgrade_page_is_reachable_only_by_its_address() -> None: import euniv.api as api_module - response = TestClient(api_module.app).get("/msg01") + response = TestClient(api_module.app).get("/tool-upgrade") assert response.status_code == 200 assert 'id="app"' in response.text assert response.headers["cache-control"] == "no-cache" diff --git a/web/src/App.vue b/web/src/App.vue index 44d6ec7..d2dbff2 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -3,7 +3,7 @@ import { onMounted, onUnmounted, ref } from "vue"; import { apiFetch, setSessionDenied } from "./shared/http"; import { darkTheme, dateZhCN, NButton, NConfigProvider, NDialogProvider, zhCN } from "naive-ui"; import LoginView from "./features/auth/LoginView.vue"; -import NoticeView from "./features/notice/NoticeView.vue"; +import ToolUpgradeView from "./features/tool-upgrade/ToolUpgradeView.vue"; import Shell from "./shell/Shell.vue"; import AdminShell from "./shell/AdminShell.vue"; import { isDark, themeOverrides } from "./shared/theme"; @@ -12,7 +12,7 @@ import { sessionFromPayload, type AppSession } from "./shared/session"; const ready = ref(false); const session = ref(null); const sessionError = ref(""); -const isNotice = window.location.pathname.replace(/\/+$/, "") === "/msg01"; +const isToolUpgrade = window.location.pathname.replace(/\/+$/, "") === "/tool-upgrade"; function applyPayload(payload: unknown) { if (!payload || typeof payload !== "object") return null; @@ -46,7 +46,7 @@ async function loadSession() { } onMounted(() => { - if (isNotice) return; + if (isToolUpgrade) return; setSessionDenied(() => { void loadSession(); }); @@ -112,7 +112,7 @@ function onLogin(next: AppSession) {