|
|
@ -55,6 +55,8 @@ class UserProvider extends ChangeNotifier {
|
|
|
|
await updateUserInfo();
|
|
|
|
await updateUserInfo();
|
|
|
|
updateConSms();
|
|
|
|
updateConSms();
|
|
|
|
updateRefSms();
|
|
|
|
updateRefSms();
|
|
|
|
|
|
|
|
updateCallSms();
|
|
|
|
|
|
|
|
updateIdleSms();
|
|
|
|
getExclude();
|
|
|
|
getExclude();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -121,14 +123,14 @@ class UserProvider extends ChangeNotifier {
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future updateSms() async {
|
|
|
|
Future updateCallSms() async {
|
|
|
|
final prefs = await SharedPreferences.getInstance();
|
|
|
|
final prefs = await SharedPreferences.getInstance();
|
|
|
|
final service = FlutterBackgroundService();
|
|
|
|
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) {
|
|
|
|
if (base.code == 0) {
|
|
|
|
await prefs.remove('refSms');
|
|
|
|
await prefs.remove('callSms');
|
|
|
|
await prefs.setString(
|
|
|
|
await prefs.setString(
|
|
|
|
'refSms',
|
|
|
|
'callSms',
|
|
|
|
(UserTool.userProvider.userInfo.tag) == ""
|
|
|
|
(UserTool.userProvider.userInfo.tag) == ""
|
|
|
|
? "${base.data['content']}"
|
|
|
|
? "${base.data['content']}"
|
|
|
|
: "【${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 {
|
|
|
|
Future updateIdleSms() async {
|
|
|
|
final prefs = await SharedPreferences.getInstance();
|
|
|
|
final prefs = await SharedPreferences.getInstance();
|
|
|
|
final service = FlutterBackgroundService();
|
|
|
|
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) {
|
|
|
|
if (base.code == 0) {
|
|
|
|
await prefs.remove('refSms');
|
|
|
|
await prefs.remove('idleSms');
|
|
|
|
await prefs.setString(
|
|
|
|
await prefs.setString(
|
|
|
|
'refSms',
|
|
|
|
'idleSms',
|
|
|
|
(UserTool.userProvider.userInfo.tag) == ""
|
|
|
|
(UserTool.userProvider.userInfo.tag) == ""
|
|
|
|
? "${base.data['content']}"
|
|
|
|
? "${base.data['content']}"
|
|
|
|
: "【${UserTool.userProvider.userInfo.tag}】${base.data['content']}");
|
|
|
|
: "【${UserTool.userProvider.userInfo.tag}】${base.data['content']}");
|
|
|
|