|
@@ -47,17 +47,17 @@ class FlutterAlibc { |
|
|
/// @return: 成功则返回的data为用户信息,失败则没有data |
|
|
/// @return: 成功则返回的data为用户信息,失败则没有data |
|
|
/// |
|
|
/// |
|
|
static Future<LoginModel> loginTaoBao() async { |
|
|
static Future<LoginModel> loginTaoBao() async { |
|
|
Map result = await (_channel.invokeMethod("loginTaoBao") as FutureOr<Map<dynamic, dynamic>>); |
|
|
|
|
|
|
|
|
Map? result = await _channel.invokeMethod("loginTaoBao"); |
|
|
// 判断成功还是失败 |
|
|
// 判断成功还是失败 |
|
|
if (result[AlibcConstKey.errorCode] != "0") { |
|
|
|
|
|
|
|
|
if (result![AlibcConstKey.errorCode] != "0") { |
|
|
return LoginModel( |
|
|
return LoginModel( |
|
|
result[AlibcConstKey.errorCode], |
|
|
result[AlibcConstKey.errorCode], |
|
|
result[AlibcConstKey.errorMessage], |
|
|
result[AlibcConstKey.errorMessage], |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
return LoginModel(result[AlibcConstKey.errorCode], result[AlibcConstKey.errorMessage], |
|
|
return LoginModel(result[AlibcConstKey.errorCode], result[AlibcConstKey.errorMessage], |
|
|
data: UserModel(result[AlibcConstKey.data]["nick"], result[AlibcConstKey.data]["avatarUrl"], result[AlibcConstKey.data]["openId"], result[AlibcConstKey.data]["openSid"], |
|
|
|
|
|
result[AlibcConstKey.data]["topAccessToken"], result[AlibcConstKey.data]["topAuthCode"])); |
|
|
|
|
|
|
|
|
data: UserModel(result[AlibcConstKey.data]["nick"], result[AlibcConstKey.data]["avatarUrl"], result[AlibcConstKey.data]["openId"], |
|
|
|
|
|
result[AlibcConstKey.data]["openSid"], result[AlibcConstKey.data]["topAccessToken"], result[AlibcConstKey.data]["topAuthCode"])); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// |
|
|
/// |
|
|