Commit 1c7e9d3e0afb913b6a30fab24b6b1017c190b6b0

Authored by yibo
1 parent 1d74085c

fix(web): api.js 用 window.location,通过 lint

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Showing 1 changed file with 1 additions and 1 deletions
apps/voko-web/src/api.js
@@ -34,7 +34,7 @@ export async function api(method, path, body, idempotencyKey) { @@ -34,7 +34,7 @@ export async function api(method, path, body, idempotencyKey) {
34 // 登录已过期:清掉 token 回登录页,登录后回到当前页(否则页面只会空白)。 34 // 登录已过期:清掉 token 回登录页,登录后回到当前页(否则页面只会空白)。
35 if (response.status === 401 && token !== null) { 35 if (response.status === 401 && token !== null) {
36 setToken(null) 36 setToken(null)
37 - location.assign(`/login?next=${encodeURIComponent(location.pathname)}`) 37 + window.location.assign(`/login?next=${encodeURIComponent(window.location.pathname)}`)
38 } 38 }
39 const json = await response.json() 39 const json = await response.json()
40 if (!response.ok) throw new Error(json.error.message) 40 if (!response.ok) throw new Error(json.error.message)