diff --git a/lib/util/net_util.dart b/lib/util/net_util.dart index 57b1715..a4ed6c6 100644 --- a/lib/util/net_util.dart +++ b/lib/util/net_util.dart @@ -218,7 +218,7 @@ class NetUtil { OnSuccess onSuccess, OnError onError, OnCache onCache, - bool showToast = true,int timeOut=15000}) async { + bool showToast = true, int timeOut = 15000}) async { var paramsData = {'postData': params ?? {}, 'queryParameters': queryParameters ?? {}}; // 根据请求参数,获取缓存的Key @@ -234,7 +234,8 @@ class NetUtil { params: params, queryParameters: queryParameters, showToast: showToast, - cache: onCache != null,timeOut: timeOut); + cache: onCache != null, + timeOut: timeOut); // TODO 解密? if (isSuccess(result)) { 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) { onError(e?.toString() ?? '未知错误'); } diff --git a/lib/util/router_util.dart b/lib/util/router_util.dart index 01e625f..7397201 100644 --- a/lib/util/router_util.dart +++ b/lib/util/router_util.dart @@ -44,7 +44,7 @@ class RouterUtil { } // TODO webView 临时代码,IOS添加原生WebView需要改动这里 - if (skipModel?.skipIdentifier == 'pub.flutter.url' && Platform.isAndroid) { + if (skipModel?.skipIdentifier == 'pub.flutter.url') { RouterUtil.openWebview(skipModel?.url, context); return; } @@ -88,11 +88,11 @@ class RouterUtil { SkipModel model = SkipModel(); model.skipIdentifier = 'pub.flutter.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); } // 回到首页