feat(http):修改请求结果
This commit is contained in:
@@ -103,6 +103,12 @@ class HttpUtils {
|
||||
// value: response.headers["authorization"]![0]);
|
||||
// }
|
||||
if (isShowLoading) EasyLoading.dismiss();
|
||||
|
||||
///转化结果
|
||||
Map<String, dynamic> map = response.data;
|
||||
if (map.keys.contains('code') && map['code'] == 401) {
|
||||
response.data = {'resultCode': 'FAIL', 'resultMsg': '请重新登录'};
|
||||
}
|
||||
netResult = NetResult(
|
||||
headers: response.headers,
|
||||
result: response.data,
|
||||
|
||||
Reference in New Issue
Block a user