From fcfbfaa1e10300e7ce37cfbc3e03f128d302a4f7 Mon Sep 17 00:00:00 2001 From: huaxuan <646903573@qq.com> Date: Thu, 21 Jul 2022 10:08:00 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E6=B7=98=E5=AE=9D=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/flutter_alibc.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/flutter_alibc.dart b/lib/flutter_alibc.dart index f47b9e6..87665fe 100644 --- a/lib/flutter_alibc.dart +++ b/lib/flutter_alibc.dart @@ -47,17 +47,17 @@ class FlutterAlibc { /// @return: 成功则返回的data为用户信息,失败则没有data /// static Future loginTaoBao() async { - Map result = await (_channel.invokeMethod("loginTaoBao") as FutureOr>); + Map? result = await _channel.invokeMethod("loginTaoBao"); // 判断成功还是失败 - if (result[AlibcConstKey.errorCode] != "0") { + if (result![AlibcConstKey.errorCode] != "0") { 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"])); } ///