fix(auth): correct resend response type and improve error messages
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user