Skip to content

Commit 021c389

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

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/logic/network/interceptor.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ class ApiInterceptor extends Interceptor {
143143
case DioExceptionType.badCertificate:
144144
return '证书有误!';
145145
case DioExceptionType.badResponse:
146-
return error.response?.statusCode == 302 ? '请输入短信验证码' : '服务器异常,请稍后重试!';
146+
return error.response?.statusCode == 302
147+
? '检测到登录需要短信验证码,请点击右上角网页登录'
148+
: '服务器异常,请稍后重试!';
147149
case DioExceptionType.cancel:
148150
return '请求已被取消,请重新请求';
149151
case DioExceptionType.connectionError:

0 commit comments

Comments
 (0)