隐藏load ,提高用户体验
This commit is contained in:
@@ -40,23 +40,23 @@ export interface UnreadMountResponse {
|
||||
class NoticeService {
|
||||
// 获取用户消息通知列表
|
||||
async getNotificationList({ notification_type, is_read }: NoticeListParams): Promise<ApiResponse<NoticeListResponse>> {
|
||||
return httpService.post("/notifications/list", { notification_type, is_read }, { showLoading: true });
|
||||
return httpService.post("/notifications/list", { notification_type, is_read }, { showLoading: false });
|
||||
}
|
||||
// 获取消息通知详情
|
||||
async getNotificationDetail(notification_id: number): Promise<ApiResponse<Notice>> {
|
||||
return httpService.post("/notifications/detail", { notification_id }, { showLoading: true });
|
||||
return httpService.post("/notifications/detail", { notification_id }, { showLoading: false });
|
||||
}
|
||||
// 标记消息为已读
|
||||
async markNotificationRead({ notification_ids, mark_all }: MarkReadParams): Promise<ApiResponse<{ marked_count: number }>> {
|
||||
return httpService.post("/notifications/mark_read", { notification_ids, mark_all }, { showLoading: true });
|
||||
return httpService.post("/notifications/mark_read", { notification_ids, mark_all }, { showLoading: false });
|
||||
}
|
||||
// 删除消息通知
|
||||
async delNotification({ notification_ids, delete_all }: DeleteParams): Promise<ApiResponse<{ deleted_count: number }>> {
|
||||
return httpService.post("/notifications/delete", { notification_ids, delete_all }, { showLoading: true });
|
||||
return httpService.post("/notifications/delete", { notification_ids, delete_all }, { showLoading: false });
|
||||
}
|
||||
// 获取未读消息数量
|
||||
async getNotificationUnreadCount(): Promise<ApiResponse<UnreadMountResponse>> {
|
||||
return httpService.post("/notifications/unread_count", {}, { showLoading: true });
|
||||
return httpService.post("/notifications/unread_count", {}, { showLoading: false });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user