提交 49eae89f authored 作者: shixiaochen's avatar shixiaochen

1、网络请求兼容code整形、字符串判断;

上级 6eb76a1e
......@@ -31,4 +31,7 @@
* ## 1.1.5
* SearchAppBar增加leadingWidth属性
* ## 1.1.6
* MyPageAppBar增加titleSpacing属性
\ No newline at end of file
* MyPageAppBar增加titleSpacing属性
* ## 1.1.7
* 网络请求兼容code整形、字符串判断
\ No newline at end of file
......@@ -131,10 +131,8 @@ abstract class BaseDio {
data: data,
options: _checkOptions(method.value, options),
);
if (response.data['code'] == 100 ||
response.data['code'] == "100" ||
response.data['code'] == -100 ||
response.data['code'] == "-100") {
var responseCode = response.data['code']?.toString();
if (responseCode == "100" || responseCode == "-100") {
logger.e("登录过期:${response.data['msg']}");
onLoginExpire();
}
......@@ -156,7 +154,8 @@ abstract class BaseDio {
Response response,
NetSuccessCallback successCallback,
NetErrorCallback? errorCallback) async {
if (response.data['code'] == 100 || response.data['code'] == "100") {
var responseCode = response.data['code']?.toString();
if (responseCode == "100" || responseCode == "-100") {
logger.e("登录过期:${response.data['msg']}");
onLoginExpire();
return;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论