chore(frontend): tighten eslint/axe gates, remove reader waivers (B5 done, spec ② complete)
CI / backend (push) Canceled after 0s
CI / frontend (push) Canceled after 0s

This commit is contained in:
2026-09-16 19:27:25 +08:00
parent 395be9688d
commit ef57b194f4
12 changed files with 99 additions and 59 deletions
+12
View File
@@ -31,6 +31,18 @@ export async function adminApi(): Promise<APIRequestContext> {
return request.newContext({ baseURL: BASE, extraHTTPHeaders: { Authorization: `Bearer ${token}` } });
}
/** adminApi 登录带 429 退避重试:三 spec 并发 worker 的登录总数可能顶到后端 1min/5 次限流门,等窗口即可;仅消耗等待预算,不改用例语义 */
export async function adminApiRetry(): Promise<APIRequestContext> {
for (let i = 0; ; i++) {
try {
return await adminApi();
} catch (e) {
if (i > 20 || !(e instanceof Error) || !e.message.includes("HTTP 429")) throw e;
await new Promise((r) => setTimeout(r, 3000));
}
}
}
export async function ensureLibrary(ctx: APIRequestContext, name: string): Promise<number> {
const libs = (await (await ctx.get("/api/libraries")).json()) as { id: number; name: string }[];
const hit = libs.find((l) => l.name === name);