From a8c89d5280ead616f49570a8b6d28a9d687bc17d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=8D=8E=E8=BD=A9?= <646903573@qq.com> Date: Wed, 14 Oct 2020 09:28:48 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=B8=A0=E9=81=93=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E3=80=81=E5=8A=A0=E5=85=A5=E8=87=AA=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E9=98=BF=E9=87=8C=E7=99=BE=E5=B7=9D=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/pubspec.yaml | 5 ++++- lib/util/taobao/taobao_auth.dart | 21 ++++++++++++++++++--- lib/zhiying_comm.dart | 2 ++ pubspec.yaml | 5 ++++- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/example/pubspec.yaml b/example/pubspec.yaml index ef050f5..477f21d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -20,7 +20,10 @@ dev_dependencies: zhiying_comm: path: ../ - flutter_alibc: ^0.0.15 + flutter_alibc: + git: + ref: 0.0.1 + url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_flutter_alibc.git # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/lib/util/taobao/taobao_auth.dart b/lib/util/taobao/taobao_auth.dart index 5eeed23..758c622 100644 --- a/lib/util/taobao/taobao_auth.dart +++ b/lib/util/taobao/taobao_auth.dart @@ -3,6 +3,7 @@ import 'package:flutter_alibc/alibc_model.dart'; import 'package:flutter_alibc/flutter_alibc.dart'; import 'package:zhiying_comm/util/taobao/taobao_auth_alert.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; +import 'dart:io'; class TaobaoAuth { // 淘宝授权 @@ -17,9 +18,23 @@ class TaobaoAuth { await NetUtil.post('/api/v1/taobao/auth', method: NetMethod.GET)); Logger.debug(data); String url = data['data']['redirect_url']; - TradeResult result = await FlutterAlibc.openByUrl(url: url); - // TradeResult result = await FlutterAlibc.openByUrl(url: ''); - Logger.debug('${result.errorCode} ${result.errorMessage} '); + print("授权链接" + url); + + if(Platform.isAndroid){ + + TradeResult result = await FlutterAlibc.openByUrl( + url: url, backUrl: "alisdk://",isAuth: true); + // TradeResult result = await FlutterAlibc.openByUrl(url: ''); + Logger.debug('${result.errorCode} ${result.errorMessage} '); + + + }else if(Platform.isIOS){ + TradeResult result = await FlutterAlibc.openByUrl( + url: url, backUrl: "alisdk://"); + // TradeResult result = await FlutterAlibc.openByUrl(url: ''); + Logger.debug('${result.errorCode} ${result.errorMessage} '); + } + } } diff --git a/lib/zhiying_comm.dart b/lib/zhiying_comm.dart index d000acc..7315d5c 100644 --- a/lib/zhiying_comm.dart +++ b/lib/zhiying_comm.dart @@ -32,3 +32,5 @@ export 'util/taobao/taobao_image_webview_loader.dart'; export 'util/taobao/taobao_loader.dart'; export 'util/widget_creater.dart'; export 'util/widget_factory.dart'; +export 'package:cached_network_image/cached_network_image.dart'; + diff --git a/pubspec.yaml b/pubspec.yaml index 7309599..ffcff69 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,7 +32,10 @@ dependencies: webview_flutter: ^0.3.22+1 # 京东sdk jdsdk: ^0.0.1 - flutter_alibc: ^0.0.15 + flutter_alibc: + git: + ref: 0.0.1 + url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_flutter_alibc.git url_launcher: ^5.6.0