From 3f9fe5144a63186dfd0f37b9172bef16688193ca Mon Sep 17 00:00:00 2001 From: Jzow Date: Wed, 17 Jul 2024 15:50:56 +0800 Subject: [PATCH] Add message notification function --- web/src/api/sys/message.ts | 21 ++++++++++ .../header/components/notify/NoticeList.vue | 3 +- .../default/header/components/notify/data.ts | 10 ++++- .../header/components/notify/index.vue | 42 ++++++++++++++----- web/src/store/modules/user.ts | 38 ++++++----------- 5 files changed, 77 insertions(+), 37 deletions(-) create mode 100644 web/src/api/sys/message.ts diff --git a/web/src/api/sys/message.ts b/web/src/api/sys/message.ts new file mode 100644 index 00000000..27b377d4 --- /dev/null +++ b/web/src/api/sys/message.ts @@ -0,0 +1,21 @@ +import { defHttp } from '@/utils/http/axios'; +import {MessageInfo, ReadMessageReq} from "@/api/sys/model/MessageModel"; +import {BaseDataResp, BaseResp} from "@/api/model/baseModel"; + +enum Api { + List = '/sys/message/list', + Read = '/sys/message/read', +} + +export function getMessageList() { + return defHttp.get>({ + url: Api.List, + }); +} + +export function readMessage(params: ReadMessageReq) { + return defHttp.post({ + url: Api.Read, + params, + }); +} \ No newline at end of file diff --git a/web/src/layouts/default/header/components/notify/NoticeList.vue b/web/src/layouts/default/header/components/notify/NoticeList.vue index 5c97ba5f..a049a81d 100644 --- a/web/src/layouts/default/header/components/notify/NoticeList.vue +++ b/web/src/layouts/default/header/components/notify/NoticeList.vue @@ -1,5 +1,5 @@