fix: 优化错误提示

This commit is contained in:
sophie committed 2026-06-12 17:04:48 +08:00
1 parent d4f629106f
commit 3f61e92549
9 files changed
+122 -23

No files matched your search

@@ -84,7 +84,17 @@ export function useLoginAuth(deps: LoginDeps, options: LoginAuthOptions) {
event?.stopPropagation();
if (!loginUsername.value.trim()) {
msg.warning(t('login.usernameRequired'));
msg.warning({
title: t('login.usernameRequired'),
message: t('login.usernameRequiredHint'),
});
return;
}
if (!loginPassword.value) {
msg.warning({
title: t('login.passwordRequired'),
message: t('login.passwordRequiredHint'),
});
return;
}
@@ -115,7 +125,10 @@ export function useLoginAuth(deps: LoginDeps, options: LoginAuthOptions) {
if (rawError === 'Database connection failed') errorText = t('login.dbConnectionFailed');
if (rawError === 'Internal server error') errorText = t('login.internalError');
console.error(e);
msg.error(errorText || t('login.requestFailed'));
msg.error({
title: t('login.failed'),
message: errorText || t('login.requestFailed'),
});
}
};