From 1c7e9d3e0afb913b6a30fab24b6b1017c190b6b0 Mon Sep 17 00:00:00 2001 From: yibo Date: Sat, 10 Oct 2026 14:46:24 +0800 Subject: [PATCH] fix(web): api.js 用 window.location,通过 lint --- apps/voko-web/src/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/voko-web/src/api.js b/apps/voko-web/src/api.js index babe169..94b0492 100644 --- a/apps/voko-web/src/api.js +++ b/apps/voko-web/src/api.js @@ -34,7 +34,7 @@ export async function api(method, path, body, idempotencyKey) { // 登录已过期:清掉 token 回登录页,登录后回到当前页(否则页面只会空白)。 if (response.status === 401 && token !== null) { setToken(null) - location.assign(`/login?next=${encodeURIComponent(location.pathname)}`) + window.location.assign(`/login?next=${encodeURIComponent(window.location.pathname)}`) } const json = await response.json() if (!response.ok) throw new Error(json.error.message) -- libgit2 0.21.4