feat: improve operations diagnostics and channel management

This commit is contained in:
hectorzhao
2026-08-09 14:27:19 +08:00
parent 44352aeb2f
commit 4724b9db6a
65 changed files with 1211 additions and 293 deletions
+5 -1
View File
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { adminApi, clientApi, type CaptchaResponse } from '@/api/adminApi';
import { consumeSessionRecovery, readSessionRecovery, writeSession, type Portal } from '@/api/session';
import { consumeSessionRecovery, markUserActivity, readSessionRecovery, writeSession, type Portal } from '@/api/session';
import { Button, Input, Modal } from '@/components/ui';
type LoginPageProps = {
@@ -57,6 +57,10 @@ export function LoginPage({ portal }: LoginPageProps) {
captchaText,
});
writeSession(session);
// A login can happen without a full page reload after the previous session
// expired. Reset the in-memory activity clock so the new session is not
// immediately locked using the previous session's stale idle duration.
markUserActivity();
const target = consumeSessionRecovery(portal)?.returnUrl;
navigate(target ?? (isAdmin ? '/admin' : '/client'), { replace: true });
} catch (err) {