|
|
|
@ -16,6 +16,10 @@ class UserProvider extends ChangeNotifier {
|
|
|
|
|
late UserInfoModel _userInfo;
|
|
|
|
|
|
|
|
|
|
UserInfoModel get userInfo => _userInfo;
|
|
|
|
|
late String _contentCon;
|
|
|
|
|
String get contentCon=>_contentCon;
|
|
|
|
|
late String _contentRef;
|
|
|
|
|
String get contentRef=>_contentRef;
|
|
|
|
|
|
|
|
|
|
Future<bool> init() async {
|
|
|
|
|
if (HiveStore.appBox?.containsKey('token') ?? false) {
|
|
|
|
@ -42,6 +46,8 @@ Future setKg(bool lockage) async{
|
|
|
|
|
_isLogin = true;
|
|
|
|
|
//每次打开app更新用户信息
|
|
|
|
|
await updateUserInfo();
|
|
|
|
|
await updateConSms();
|
|
|
|
|
await updateRefSms();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future logout() async {
|
|
|
|
@ -61,4 +67,23 @@ Future setKg(bool lockage) async{
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future updateConSms() async {
|
|
|
|
|
var base = await apiClient.request(API.app.find,data: {'status': 1});
|
|
|
|
|
if (base.code == 0) {
|
|
|
|
|
_contentCon = base.data['content'];
|
|
|
|
|
} else {
|
|
|
|
|
CloudToast.show(base.msg);
|
|
|
|
|
}
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future updateRefSms() async {
|
|
|
|
|
var base = await apiClient.request(API.app.find,data: {'status': 2});
|
|
|
|
|
if (base.code == 0) {
|
|
|
|
|
_contentRef = base.data['content'];
|
|
|
|
|
} else {
|
|
|
|
|
CloudToast.show(base.msg);
|
|
|
|
|
}
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|