支持项目编码访问单项目公示屏
需求:无需查询公示 Token,直接通过项目编码打开单项目公示页。 实现:规范化项目编码并按 code 查询,同时保留既有 Token 哈希查询;补充前后端及集成回归测试。
This commit is contained in:
@@ -120,6 +120,20 @@ describe("public display overview", () => {
|
||||
|
||||
expect(fetchMock.mock.calls[0][0]).toBe("/api/display/overview");
|
||||
});
|
||||
|
||||
it("loads one project display using its project code", async () => {
|
||||
const fetchMock = vi.fn().mockResolvedValue(jsonResponse({
|
||||
project_name: "峡谷漂流",
|
||||
status: "RUNNING",
|
||||
current_batch: null,
|
||||
recent_batches: [],
|
||||
}));
|
||||
vi.stubGlobal("fetch", fetchMock);
|
||||
|
||||
await api.display("RAFT");
|
||||
|
||||
expect(fetchMock.mock.calls[0][0]).toBe("/api/display/RAFT/snapshot");
|
||||
});
|
||||
});
|
||||
|
||||
describe("isolated portal authentication", () => {
|
||||
|
||||
Reference in New Issue
Block a user