Browse Source

1.授权时更新taobo状态

tags/0.0.13+2
“yanghuaxuan” 3 years ago
parent
commit
f319697f68
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      lib/util/taobao/taobao_auth.dart

+ 2
- 1
lib/util/taobao/taobao_auth.dart View File

@@ -50,13 +50,14 @@ class TaobaoAuth {
// result = await FlutterAlibc.openByUrl(url: url, backUrl: "alisdk://", isAuth: true); // result = await FlutterAlibc.openByUrl(url: url, backUrl: "alisdk://", isAuth: true);
print("name: $name" + "\n" + "alibcAppKey: $alibcAppKey"); print("name: $name" + "\n" + "alibcAppKey: $alibcAppKey");
var resultMsg = await FlutterAlibc.taoKeLoginNew(name, alibcAppKey); var resultMsg = await FlutterAlibc.taoKeLoginNew(name, alibcAppKey);
FlutterAlibc.loginOut();
if (!EmptyUtil.isEmpty(resultMsg["accessToken"])) { if (!EmptyUtil.isEmpty(resultMsg["accessToken"])) {
print("access 成功 $resultMsg"); print("access 成功 $resultMsg");
Map<String, dynamic> params = {}; Map<String, dynamic> params = {};
params['access_token'] = resultMsg["accessToken"]?.toString(); params['access_token'] = resultMsg["accessToken"]?.toString();
await NetUtil.post('/api/v1/tbredirect', await NetUtil.post('/api/v1/tbredirect',
params: params, method: NetMethod.POST); params: params, method: NetMethod.POST);

} else { } else {
print("access 失败 $resultMsg"); print("access 失败 $resultMsg");
Fluttertoast.showToast(msg: "access 失败 $resultMsg"); Fluttertoast.showToast(msg: "access 失败 $resultMsg");


Loading…
Cancel
Save