Browse Source

1、缓存回调的判断。如果为空就不触发

tags/0.0.1
PH2 4 years ago
parent
commit
d003e762d3
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      lib/util/net_util.dart

+ 2
- 3
lib/util/net_util.dart View File

@@ -64,7 +64,7 @@ class NetUtil {
headers: {'device': 'wx_applet', 'Platform': 'wx_applet'},
));
_dio.interceptors.add(_NetInterceptors());
_dio.interceptors.add(LogInterceptor());
// _dio.interceptors.add(LogInterceptor());

const bool inProduction = const bool.fromEnvironment("dart.vm.product");
if (proxyUrl != null && proxyUrl != '' && !inProduction) {
@@ -287,8 +287,7 @@ class NetUtil {
(cacheMap[GlobalConfig.HTTP_RESPONSE_KEY_CODE] ==
GlobalConfig.RESPONSE_SUCCESS_CODE ||
cacheMap[GlobalConfig.HTTP_RESPONSE_KEY_CODE] ==
'${GlobalConfig.RESPONSE_SUCCESS_CODE}') &&
null != cacheMap[GlobalConfig.HTTP_RESPONSE_KEY_DATA]) {
'${GlobalConfig.RESPONSE_SUCCESS_CODE}') && !EmptyUtil.isEmpty(cacheMap[GlobalConfig.HTTP_RESPONSE_KEY_DATA])) {
onCache(cacheMap[GlobalConfig.HTTP_RESPONSE_KEY_DATA]);
return;
}


Loading…
Cancel
Save