Skip to content

Commit 9160874

Browse files
committed
feat: add status code checking for bad responses in Dio
1 parent cc6be39 commit 9160874

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/logic/network/interceptor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class ApiInterceptor extends Interceptor {
143143
case DioExceptionType.badCertificate:
144144
return '证书有误!';
145145
case DioExceptionType.badResponse:
146-
return '服务器异常,请稍后重试!';
146+
return error.response?.statusCode == 302 ? '请输入短信验证码' : '服务器异常,请稍后重试!';
147147
case DioExceptionType.cancel:
148148
return '请求已被取消,请重新请求';
149149
case DioExceptionType.connectionError:

0 commit comments

Comments
 (0)