|
|
@ -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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|