更新安卓通知栏提示
This commit is contained in:
@@ -141,7 +141,7 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
||||
"type": type,
|
||||
"userName": account,
|
||||
"password": password,
|
||||
'khCode':'mht',
|
||||
'khCode': 'mht',
|
||||
};
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
@@ -164,6 +164,8 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
||||
final box = GetStorage();
|
||||
box.write('token', token); // 存储 token
|
||||
box.write('user', userInfoController.model.user!.toJson()); // 存储用户信息
|
||||
//todo 更新消息通知
|
||||
updateAppSystemNotify(true);
|
||||
},
|
||||
onFailure: (res) {
|
||||
message = res.msg!;
|
||||
@@ -341,3 +343,26 @@ class MHTLoginController extends GetControllerEx<LoginModel> {
|
||||
corpId: CommonVariables.wxCorpId, url: CommonVariables.wxKfUrl));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateAppSystemNotify(bool status) async {
|
||||
final box = GetStorage();
|
||||
var data = {
|
||||
"pid": box.read("rid"),
|
||||
"status": status,
|
||||
};
|
||||
String serviceAddress = ServiceConstant.service_address;
|
||||
String serviceName = ServiceConstant.server_service;
|
||||
String serviceApi = ServiceConstant.app_system_push_message;
|
||||
String queryUrl = "${serviceAddress}${serviceName}${serviceApi}";
|
||||
await requestWithLog(
|
||||
logTitle: "激活消息通知",
|
||||
method: MyHttpMethod.put,
|
||||
queryUrl: queryUrl,
|
||||
data: data,
|
||||
onSuccess: (res) {
|
||||
print(res);
|
||||
},
|
||||
onFailure: (res) {
|
||||
print(res);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user