From 5f76e3bb537fd7536da5b647b1491c6fa46bd152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 2 Oct 2026 11:48:15 +0800 Subject: [PATCH] =?UTF-8?q?AGC=E8=AE=A4=E8=AF=81=E6=9C=AA=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E6=8B=92=E7=BB=9D=E8=A1=A5=E5=8F=AF=E8=A7=81=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AuthenticatedClient 三个 catch 的 default 分支在 rethrow 前补一行泛化提示,界面不再停在无解释状态 - 上报判据用例同步断言 Tauri 意外拒绝形状也会显示这条提示 --- apps/ai-game-creator-shell/src/app/AuthenticatedClient.tsx | 6 ++++++ .../tests/authFailureReporting.test.tsx | 6 ++++++ 2 files changed, 12 insertions(+) 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(); }