From 175838f7c5f8b49da89c57b692b876cef6143b7e Mon Sep 17 00:00:00 2001 From: Timi Date: Fri, 21 Aug 2026 01:39:43 +0800 Subject: [PATCH] add notify user --- src/api/NotifyAPI.ts | 8 ++++++++ src/types/Notify.ts | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/api/NotifyAPI.ts b/src/api/NotifyAPI.ts index da8db85..20c3439 100644 --- a/src/api/NotifyAPI.ts +++ b/src/api/NotifyAPI.ts @@ -29,6 +29,13 @@ async function markInternalRead(id: string): Promise { }); } +/** 删除当前用户的一条站内通知。 */ +async function deleteInternal(id: string): Promise { + await axios.post(`${BASE_URI}/delete`, undefined, { + params: { id } + }); +} + /** 标记当前用户全部站内通知已读。 */ async function markAllInternalRead(): Promise { await axios.post(`${BASE_URI}/read/all`); @@ -39,5 +46,6 @@ export default { listInternal, countUnreadInternal, markInternalRead, + deleteInternal, markAllInternalRead }; diff --git a/src/types/Notify.ts b/src/types/Notify.ts index f699549..a2688a6 100644 --- a/src/types/Notify.ts +++ b/src/types/Notify.ts @@ -1,4 +1,5 @@ import type { Model } from "./Model"; +import type { User } from "./User"; /** 通知消息类型 */ export type NotifyMsgType = "INTERNAL" | "SMS" | "MAIL" | "HTTP" | "WECHAT"; @@ -54,4 +55,8 @@ export type NotifyDetail = { readAt?: number; /** 所属通知 */ notify?: Notify; + /** 发送用户 */ + fromUser?: User; + /** 接收用户 */ + toUser?: User; } & Model;