From 93791a0c6cb745ad3fa969c1f580c49525981c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyanghuaxuan=E2=80=9D?= <“646903573@qq.com”> Date: Fri, 23 Apr 2021 12:08:28 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=B6=85=E6=97=B6,=E5=8E=BB=E9=99=A4ioswebvi?= =?UTF-8?q?ew=E6=89=93=E5=BC=80=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/util/net_util.dart | 9 +++++---- lib/util/router_util.dart | 12 ++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) 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); } // 回到首页