Compare commits
1 Commits
v0.2.0
...
fix/logout
| Author | SHA1 | Date | |
|---|---|---|---|
| 21174dc5cb |
@@ -1449,6 +1449,11 @@ export async function apiLogout() {
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
headers: clientHeaders(),
|
headers: clientHeaders(),
|
||||||
});
|
});
|
||||||
|
// 主动登出后本标签页不再算"曾登录":否则登出后收到的首个 401 会被
|
||||||
|
// notifySessionEnded 误判为"被顶下线",误弹"登录已失效"弹窗
|
||||||
|
if (res.ok) {
|
||||||
|
sessionSeen = false;
|
||||||
|
}
|
||||||
return res.json();
|
return res.json();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1626,6 +1631,9 @@ export async function apiAdminAnalytics(range: "7d" | "30d" = "7d"): Promise<Ana
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function apiTelemetryPageView(path: string, ref: string): Promise<void> {
|
export async function apiTelemetryPageView(path: string, ref: string): Promise<void> {
|
||||||
|
// 游客尚无 CSRF cookie 时该 POST 必然 403(响应补发的 cookie 本请求用不上),
|
||||||
|
// 直接跳过:后续 GET 补发 cookie 之后的页面浏览照常上报
|
||||||
|
if (!getCSRFToken()) return;
|
||||||
try {
|
try {
|
||||||
await fetchWithRefresh("/api/telemetry/pageview", {
|
await fetchWithRefresh("/api/telemetry/pageview", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|||||||
Reference in New Issue
Block a user