|
|
@@ -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<UserInfoNotifier>(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<String, dynamic>.from( |
|
|
|