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