fix: 系统消息标记已读

This commit is contained in:
guozhigq
2024-08-25 22:07:42 +08:00
parent 9082f0299d
commit 0803444d74
3 changed files with 36 additions and 2 deletions

View File

@ -554,4 +554,8 @@ class Api {
/// 系统通知
static const String messageSystemAPi =
'${HttpString.messageBaseUrl}/x/sys-msg/query_unified_notify';
/// 系统通知标记已读
static const String systemMarkRead =
'${HttpString.messageBaseUrl}/x/sys-msg/update_cursor';
}

View File

@ -298,7 +298,6 @@ class MsgHttp {
});
if (res.data['code'] == 0) {
try {
print(res.data['data']['system_notify_list']);
return {
'status': true,
'data': res.data['data']['system_notify_list']
@ -312,4 +311,23 @@ class MsgHttp {
return {'status': false, 'date': [], 'msg': res.data['message']};
}
}
// 系统消息标记已读
static Future systemMarkRead(int cursor) async {
String csrf = await Request.getCsrf();
var res = await Request().get(Api.systemMarkRead, data: {
'csrf': csrf,
'cursor': cursor,
});
if (res.data['code'] == 0) {
return {
'status': true,
};
} else {
return {
'status': false,
'msg': res.data['message'],
};
}
}
}