fix(auth): correct resend response type and improve error messages

This commit is contained in:
qzl
2026-02-26 12:13:50 +08:00
parent 11666e6492
commit cc7a70d793
7 changed files with 174 additions and 219 deletions
-6
View File
@@ -40,9 +40,6 @@ abstract class ApiException implements Exception {
}
static String _localizeError(String detail, int? statusCode) {
if (statusCode == 401) {
return '邮箱或密码错误';
}
if (statusCode == 403) {
return '没有权限执行此操作';
}
@@ -55,9 +52,6 @@ abstract class ApiException implements Exception {
if (statusCode != null && statusCode >= 500) {
return '服务器错误,请稍后再试';
}
if (detail.contains('credentials') || detail.contains('password')) {
return '邮箱或密码错误';
}
return detail;
}
}