AGC认证未识别拒绝补可见提示
- AuthenticatedClient 三个 catch 的 default 分支在 rethrow 前补一行泛化提示,界面不再停在无解释状态 - 上报判据用例同步断言 Tauri 意外拒绝形状也会显示这条提示
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,6 +172,12 @@ describe('认证失败的上报判据', () => {
|
||||
source: 'unhandledrejection',
|
||||
message: 'IPC 桥接不可用',
|
||||
});
|
||||
// 映射外的拒绝仍然上报,但界面要给一行泛化提示,不能停在无解释的登录页。
|
||||
expect(
|
||||
await screen.findByText(
|
||||
'登录服务返回了未识别的错误,请重试或提交错误报告',
|
||||
),
|
||||
).not.toBeNull();
|
||||
} finally {
|
||||
uninstall();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user