|
|
|
@ -55,6 +55,8 @@ class UserProvider extends ChangeNotifier {
|
|
|
|
|
await updateUserInfo();
|
|
|
|
|
updateConSms();
|
|
|
|
|
updateRefSms();
|
|
|
|
|
updateCallSms();
|
|
|
|
|
updateIdleSms();
|
|
|
|
|
getExclude();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -121,14 +123,14 @@ class UserProvider extends ChangeNotifier {
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future updateSms() async {
|
|
|
|
|
Future updateCallSms() async {
|
|
|
|
|
final prefs = await SharedPreferences.getInstance();
|
|
|
|
|
final service = FlutterBackgroundService();
|
|
|
|
|
var base = await apiClient.request(API.content.find, data: {'status': 2});
|
|
|
|
|
var base = await apiClient.request(API.content.find, data: {'status': 3});
|
|
|
|
|
if (base.code == 0) {
|
|
|
|
|
await prefs.remove('refSms');
|
|
|
|
|
await prefs.remove('callSms');
|
|
|
|
|
await prefs.setString(
|
|
|
|
|
'refSms',
|
|
|
|
|
'callSms',
|
|
|
|
|
(UserTool.userProvider.userInfo.tag) == ""
|
|
|
|
|
? "${base.data['content']}"
|
|
|
|
|
: "【${UserTool.userProvider.userInfo.tag}】${base.data['content']}");
|
|
|
|
@ -147,11 +149,11 @@ class UserProvider extends ChangeNotifier {
|
|
|
|
|
Future updateIdleSms() async {
|
|
|
|
|
final prefs = await SharedPreferences.getInstance();
|
|
|
|
|
final service = FlutterBackgroundService();
|
|
|
|
|
var base = await apiClient.request(API.content.find, data: {'status': 2});
|
|
|
|
|
var base = await apiClient.request(API.content.find, data: {'status': 4});
|
|
|
|
|
if (base.code == 0) {
|
|
|
|
|
await prefs.remove('refSms');
|
|
|
|
|
await prefs.remove('idleSms');
|
|
|
|
|
await prefs.setString(
|
|
|
|
|
'refSms',
|
|
|
|
|
'idleSms',
|
|
|
|
|
(UserTool.userProvider.userInfo.tag) == ""
|
|
|
|
|
? "${base.data['content']}"
|
|
|
|
|
: "【${UserTool.userProvider.userInfo.tag}】${base.data['content']}");
|
|
|
|
|