fix: 说明页只保留复制地址

This commit is contained in:
Nixevol
2026-11-18 10:32:02 +08:00
parent d0e2d93bf9
commit 752183031c
5 changed files with 23 additions and 23 deletions
+3 -3
View File
@@ -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="页面不存在")
+2 -2
View File
@@ -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"