master
戴余标 2 years ago
parent a1648b1001
commit 232e53aa50

@ -27,7 +27,6 @@ class UserProvider extends ChangeNotifier {
String get contentRef => _contentRef; String get contentRef => _contentRef;
Future<bool> init() async { Future<bool> init() async {
if (HiveStore.appBox?.containsKey('token') ?? false) { if (HiveStore.appBox?.containsKey('token') ?? false) {
final token = HiveStore.appBox?.get('token') as String; final token = HiveStore.appBox?.get('token') as String;
@ -81,9 +80,15 @@ class UserProvider extends ChangeNotifier {
await prefs.remove('conSms'); await prefs.remove('conSms');
await prefs.setString('conSms', base.data['content']); await prefs.setString('conSms', base.data['content']);
service.invoke("stopService"); service.invoke("stopService");
if(prefs.getBool('kg')!){
Future.delayed(const Duration(seconds: 1), () async {
service.startService();
});
}
} else { } else {
CloudToast.show(base.msg); CloudToast.show(base.msg);
} }
notifyListeners(); notifyListeners();
} }
@ -93,11 +98,13 @@ class UserProvider extends ChangeNotifier {
var base = await apiClient.request(API.app.find, data: {'status': 2}); var base = await apiClient.request(API.app.find, data: {'status': 2});
if (base.code == 0) { if (base.code == 0) {
await prefs.remove('refSms'); await prefs.remove('refSms');
print(base.data['content']);
await prefs.setString('refSms', base.data['content']); await prefs.setString('refSms', base.data['content']);
print(prefs.getString('refSms'));
service.invoke("stopService"); service.invoke("stopService");
if(prefs.getBool('kg')!){
Future.delayed(const Duration(seconds: 1), () async {
service.startService();
});
}
} else { } else {
CloudToast.show(base.msg); CloudToast.show(base.msg);
} }

@ -117,7 +117,7 @@ class _ContentConnectPageState extends State<ContentConnectPage> {
CloudToast.show(res.msg); CloudToast.show(res.msg);
} }
} else { } else {
if (UserTool.userProvider.isLogin) { if (UserTool.userProvider.userInfo.isVip==1) {
if (textListSMS.length > 5) { if (textListSMS.length > 5) {
BotToast.showText(text: '自定义数量已达上限,请先删除不需要的短信'); BotToast.showText(text: '自定义数量已达上限,请先删除不需要的短信');
} else { } else {
@ -129,7 +129,7 @@ class _ContentConnectPageState extends State<ContentConnectPage> {
)); ));
} }
} else { } else {
BotToast.showText(text: '请先登录'); BotToast.showText(text: '请先开通会员');
} }
} }
setState(() {}); setState(() {});

@ -118,7 +118,7 @@ class _ContentRefusePageState extends State<ContentRefusePage> {
CloudToast.show(res.msg); CloudToast.show(res.msg);
} }
} else { } else {
if (userProvider.isLogin) { if (userProvider.userInfo.isVip==1) {
if (textListSMS.length > 5) { if (textListSMS.length > 5) {
BotToast.showText(text: '自定义数量已达上限,请先删除不需要的短信'); BotToast.showText(text: '自定义数量已达上限,请先删除不需要的短信');
} else { } else {
@ -130,7 +130,7 @@ class _ContentRefusePageState extends State<ContentRefusePage> {
)); ));
} }
} else { } else {
BotToast.showText(text: '请先登录'); BotToast.showText(text: '请先开通会员');
} }
} }
setState(() {}); setState(() {});

Loading…
Cancel
Save