Parcourir la source

1.修改渠道授权、加入自维护阿里百川插件

tags/0.0.1
杨华轩 il y a 4 ans
Parent
révision
a8c89d5280
4 fichiers modifiés avec 28 ajouts et 5 suppressions
  1. +4
    -1
      example/pubspec.yaml
  2. +18
    -3
      lib/util/taobao/taobao_auth.dart
  3. +2
    -0
      lib/zhiying_comm.dart
  4. +4
    -1
      pubspec.yaml

+ 4
- 1
example/pubspec.yaml Voir le fichier

@@ -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


+ 18
- 3
lib/util/taobao/taobao_auth.dart Voir le fichier

@@ -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} ');
}
}
}



+ 2
- 0
lib/zhiying_comm.dart Voir le fichier

@@ -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';


+ 4
- 1
pubspec.yaml Voir le fichier

@@ -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




Chargement…
Annuler
Enregistrer