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) {