diff --git a/apps/ai-game-creator-shell/src/app/AuthenticatedClient.tsx b/apps/ai-game-creator-shell/src/app/AuthenticatedClient.tsx index a35b82a5d..0eb882bd8 100644 --- a/apps/ai-game-creator-shell/src/app/AuthenticatedClient.tsx +++ b/apps/ai-game-creator-shell/src/app/AuthenticatedClient.tsx @@ -459,6 +459,10 @@ export function AuthenticatedClient({ } default: { expectNever(failure); + // 结构化映射外(Tauri 级失败等):仍然原样抛出上报,但界面给一行泛化提示,别停在空白状态。 + const text = '登录服务返回了未识别的错误,请重试或提交错误报告'; + setAuthCheckError(text); + setLoginStatus(text); throw error; } } @@ -723,6 +727,7 @@ export function AuthenticatedClient({ } default: { expectNever(failure); + setLoginStatus('登录服务返回了未识别的错误,请重试或提交错误报告'); throw error; } } @@ -955,6 +960,7 @@ export function AuthenticatedClient({ } default: { expectNever(failure); + setLoginStatus('登录服务返回了未识别的错误,请重试或提交错误报告'); throw error; } } diff --git a/apps/ai-game-creator-shell/tests/authFailureReporting.test.tsx b/apps/ai-game-creator-shell/tests/authFailureReporting.test.tsx index 1b7c2bd4e..b088f8435 100644 --- a/apps/ai-game-creator-shell/tests/authFailureReporting.test.tsx +++ b/apps/ai-game-creator-shell/tests/authFailureReporting.test.tsx @@ -172,6 +172,12 @@ describe('认证失败的上报判据', () => { source: 'unhandledrejection', message: 'IPC 桥接不可用', }); + // 映射外的拒绝仍然上报,但界面要给一行泛化提示,不能停在无解释的登录页。 + expect( + await screen.findByText( + '登录服务返回了未识别的错误,请重试或提交错误报告', + ), + ).not.toBeNull(); } finally { uninstall(); }