SSE鉴权失效停止重连清理会话跳登录并降噪4xx错误日志

This commit is contained in:
yml2213
2026-08-23 11:01:41 +08:00
parent 8e49b7d047
commit 70b31f4874
4 changed files with 32 additions and 9 deletions
@@ -45,6 +45,11 @@ export default function WorkerLayout() {
url: '/api/v1/worker/realtime',
token: getWorkerToken(),
onEvent: (event) => applyWorkerRealtimeEvent(event, queryClient),
// 会话过期时清登录态回登录页,避免 SSE 带着失效 token 无限重连刷 401。
onAuthExpired: () => {
clearWorkerSession()
void navigate('/', { replace: true })
},
})
async function submitLogout() {