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