@@ -218,7 +218,7 @@ class NetUtil { | |||||
OnSuccess onSuccess, | OnSuccess onSuccess, | ||||
OnError onError, | OnError onError, | ||||
OnCache onCache, | OnCache onCache, | ||||
bool showToast = true,int timeOut=15000}) async { | |||||
bool showToast = true, int timeOut = 15000}) async { | |||||
var paramsData = {'postData': params ?? {}, 'queryParameters': queryParameters ?? {}}; | var paramsData = {'postData': params ?? {}, 'queryParameters': queryParameters ?? {}}; | ||||
// 根据请求参数,获取缓存的Key | // 根据请求参数,获取缓存的Key | ||||
@@ -234,7 +234,8 @@ class NetUtil { | |||||
params: params, | params: params, | ||||
queryParameters: queryParameters, | queryParameters: queryParameters, | ||||
showToast: showToast, | showToast: showToast, | ||||
cache: onCache != null,timeOut: timeOut); | |||||
cache: onCache != null, | |||||
timeOut: timeOut); | |||||
// TODO 解密? | // TODO 解密? | ||||
if (isSuccess(result)) { | if (isSuccess(result)) { | ||||
if (onSuccess != null) { | if (onSuccess != null) { | ||||
@@ -250,8 +251,8 @@ class NetUtil { | |||||
: '未知错误' | : '未知错误' | ||||
: '未知错误'); | : '未知错误'); | ||||
} | } | ||||
} catch (e) { | |||||
Logger.error('error: ' + e.toString()); | |||||
} catch (e, s) { | |||||
Logger.error('error: ' + e.toString() + "\n" + s.toString()); | |||||
if (onError != null) { | if (onError != null) { | ||||
onError(e?.toString() ?? '未知错误'); | onError(e?.toString() ?? '未知错误'); | ||||
} | } | ||||
@@ -44,7 +44,7 @@ class RouterUtil { | |||||
} | } | ||||
// TODO webView 临时代码,IOS添加原生WebView需要改动这里 | // TODO webView 临时代码,IOS添加原生WebView需要改动这里 | ||||
if (skipModel?.skipIdentifier == 'pub.flutter.url' && Platform.isAndroid) { | |||||
if (skipModel?.skipIdentifier == 'pub.flutter.url') { | |||||
RouterUtil.openWebview(skipModel?.url, context); | RouterUtil.openWebview(skipModel?.url, context); | ||||
return; | return; | ||||
} | } | ||||
@@ -88,11 +88,11 @@ class RouterUtil { | |||||
SkipModel model = SkipModel(); | SkipModel model = SkipModel(); | ||||
model.skipIdentifier = 'pub.flutter.url'; | model.skipIdentifier = 'pub.flutter.url'; | ||||
model.url = url; | model.url = url; | ||||
if (Platform.isAndroid) { | |||||
Application.doStringParamsMethod("openUrl", data: {"url": model.url}); | |||||
return null; | |||||
} | |||||
RouterUtil.route(model, model.toJson(), context); | |||||
Application.doStringParamsMethod("openUrl", data: {"url": model.url}); | |||||
return null; | |||||
// | |||||
// RouterUtil.route(model, model.toJson(), context); | |||||
} | } | ||||
// 回到首页 | // 回到首页 | ||||