更新
This commit is contained in:
@@ -184,24 +184,30 @@ class LoginController extends GetControllerEx<LoginModel> {
|
||||
3、对于iOS应用,考虑到iOS应用商店审核指南中的相关规定,建议开发者接入微信登录时,先检测用户手机是否已安装微信客户端
|
||||
(使用sdk中isWXAppInstalled函数 ),对未安装的用户隐藏微信登录按钮,只提供其他登录方式(比如手机号注册登录、游客登录等)
|
||||
*/
|
||||
if (isAndroid) {
|
||||
bool isWeChatInstalled = await fluwx.isWeChatInstalled;
|
||||
if (!isWeChatInstalled) {
|
||||
TopSlideNotification.show(context,
|
||||
text: "微信安装提示".tr, textColor: themeController.currentColor.sc9);
|
||||
return;
|
||||
try {
|
||||
if (isAndroid) {
|
||||
bool isWeChatInstalled = await fluwx.isWeChatInstalled;
|
||||
if (!isWeChatInstalled) {
|
||||
TopSlideNotification.show(context,
|
||||
text: "微信安装提示".tr, textColor: themeController.currentColor.sc9);
|
||||
return;
|
||||
}
|
||||
}
|
||||
fluwx
|
||||
.authBy(
|
||||
which: NormalAuth(
|
||||
scope: 'snsapi_userinfo',
|
||||
state: 'wechat_sdk_theh_wxlogin',
|
||||
))
|
||||
.then((data) {
|
||||
//返回true表示成功或者false表示失败,这边没有意义从login_controller页面构造函数监听中去处理
|
||||
debugPrint('msg:$data');
|
||||
EasyDartModule.logger.error('msg:$data');
|
||||
});
|
||||
} catch (e) {
|
||||
debugPrint('msg:$e');
|
||||
EasyDartModule.logger.error('msg:$e');
|
||||
}
|
||||
fluwx
|
||||
.authBy(
|
||||
which: NormalAuth(
|
||||
scope: 'snsapi_userinfo',
|
||||
state: 'wechat_sdk_theh_wxlogin',
|
||||
))
|
||||
.then((data) {
|
||||
//返回true表示成功或者false表示失败,这边没有意义从login_controller页面构造函数监听中去处理
|
||||
debugPrint('msg:$data');
|
||||
});
|
||||
}
|
||||
|
||||
Future<ApiResponse> loginByWechatCode(String code) async {
|
||||
@@ -236,8 +242,7 @@ class LoginController extends GetControllerEx<LoginModel> {
|
||||
bool isWeChatInstalled = await fluwx.isWeChatInstalled;
|
||||
if (!isWeChatInstalled) {
|
||||
TopSlideNotification.show(context,
|
||||
text: "微信客服提示".tr,
|
||||
textColor: themeController.currentColor.sc9);
|
||||
text: "微信客服提示".tr, textColor: themeController.currentColor.sc9);
|
||||
return;
|
||||
}
|
||||
TopSlideNotification.show(context,
|
||||
|
||||
Reference in New Issue
Block a user