diff --git a/lib/pages/security_page/security_bind_alipay/security_bind_alipay_page.dart b/lib/pages/security_page/security_bind_alipay/security_bind_alipay_page.dart index 5e3df54..e4c3de1 100644 --- a/lib/pages/security_page/security_bind_alipay/security_bind_alipay_page.dart +++ b/lib/pages/security_page/security_bind_alipay/security_bind_alipay_page.dart @@ -225,7 +225,7 @@ class _SecurityBindAlipayContainerState setState(() {}); }); }else{ - Fluttertoast.showToast(msg: '获取验证码失败'); + // Fluttertoast.showToast(msg: '获取验证码失败'); } } } diff --git a/lib/pages/security_page/security_mobile/security_mobile.dart b/lib/pages/security_page/security_mobile/security_mobile.dart index 0661915..a167a01 100644 --- a/lib/pages/security_page/security_mobile/security_mobile.dart +++ b/lib/pages/security_page/security_mobile/security_mobile.dart @@ -197,7 +197,7 @@ class _SecurityMobileContainerState extends State<_SecurityMobileContainer> { setState(() {}); }); } else { - Fluttertoast.showToast(msg: '获取验证码失败'); + // Fluttertoast.showToast(msg: '获取验证码失败'); } } diff --git a/lib/pages/security_page/security_mobile/security_mobile_unbind.dart b/lib/pages/security_page/security_mobile/security_mobile_unbind.dart index 22269e0..9d44f54 100644 --- a/lib/pages/security_page/security_mobile/security_mobile_unbind.dart +++ b/lib/pages/security_page/security_mobile/security_mobile_unbind.dart @@ -164,7 +164,7 @@ class _SecurityMobileUnbindState extends State { setState(() {}); }); } else { - Fluttertoast.showToast(msg: '获取验证码失败'); + // Fluttertoast.showToast(msg: '获取验证码失败'); } } diff --git a/lib/pages/security_page/security_page.dart b/lib/pages/security_page/security_page.dart index 5bc14b3..c2923eb 100644 --- a/lib/pages/security_page/security_page.dart +++ b/lib/pages/security_page/security_page.dart @@ -4,6 +4,7 @@ import 'package:zhiying_base_widget/pages/security_page/models/security_style_mo import 'package:zhiying_base_widget/pages/security_page/security_page_bloc.dart'; import 'package:zhiying_comm/util/base_bloc.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; +import 'package:provider/provider.dart'; /// /// 账号安全 @@ -41,6 +42,14 @@ class _SecurityContainer extends StatefulWidget { class _SecurityContainerState extends State<_SecurityContainer> { SecurityPageBloc _bloc; + UserInfoModel _user; + + @override + void didChangeDependencies() { + _user = Provider.of(context).userInfo; + super.didChangeDependencies(); + } + @override void initState() { @@ -149,6 +158,18 @@ class _SecurityContainerState extends State<_SecurityContainer> { ), ), onTap: () async { + // 淘宝授权不跳转 + if(item.skipIdentifier == 'pub.flutter.account_security_toabao_auth'){ + if(_user == null || EmptyUtil.isEmpty(_user.token)){ + RouterUtil.goLogin(context); + return; + } + if( !(_user?.isTBAuth ?? false)) { + // 淘宝授权 + await TaobaoAuth.auth(context); + } + return; + } await RouterUtil.route( item, Map.from( diff --git a/lib/pages/security_page/security_password/security_password.dart b/lib/pages/security_page/security_password/security_password.dart index b781178..0fee690 100644 --- a/lib/pages/security_page/security_password/security_password.dart +++ b/lib/pages/security_page/security_password/security_password.dart @@ -167,7 +167,7 @@ class _SecurityPasswordState extends State { setState(() {}); }); }else{ - Fluttertoast.showToast(msg: '获取验证码失败'); + // Fluttertoast.showToast(msg: '获取验证码失败'); } // NetUtil.request('/api/v1/settings/account/security/password/sms', diff --git a/lib/pages/security_page/security_unbind_alipay/security_unbin_alipay.dart b/lib/pages/security_page/security_unbind_alipay/security_unbin_alipay.dart index cd73011..82b5300 100644 --- a/lib/pages/security_page/security_unbind_alipay/security_unbin_alipay.dart +++ b/lib/pages/security_page/security_unbind_alipay/security_unbin_alipay.dart @@ -155,7 +155,7 @@ class _SecurityUnbinAlipayState extends State { setState(() {}); }); } else { - Fluttertoast.showToast(msg: '获取验证码失败'); + // Fluttertoast.showToast(msg: '获取验证码失败'); } } diff --git a/lib/pages/setting_page/setting_page.dart b/lib/pages/setting_page/setting_page.dart index 09f30df..290c52d 100644 --- a/lib/pages/setting_page/setting_page.dart +++ b/lib/pages/setting_page/setting_page.dart @@ -44,7 +44,9 @@ class _SettingContainerState extends State<_SettingContainer> { @override void initState() { _bloc = BlocProvider.of(context); - _bloc.loadData(widget.data['skip_identifier']); + // if(!EmptyUtil.isEmpty(widget.data)) { + _bloc.loadData(widget.data['skip_identifier']); + // } super.initState(); } diff --git a/lib/widgets/mine/mine_nav/mine_nav.dart b/lib/widgets/mine/mine_nav/mine_nav.dart index d8a35b6..0da777d 100644 --- a/lib/widgets/mine/mine_nav/mine_nav.dart +++ b/lib/widgets/mine/mine_nav/mine_nav.dart @@ -95,7 +95,7 @@ final SkipModel skipModel; ), onTap:() { - RouterUtil.route(skipModel, null, context); + RouterUtil.route(skipModel, skipModel.toJson(), context); }); } }