From fdd4b9a4dfcb600e8455c5c402fc6f818b6f1507 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Sun, 19 May 2024 22:58:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/system/index.ts | 1 + src/apis/system/message.ts | 19 ++++ src/apis/system/type.ts | 22 +++++ src/apis/system/user-center.ts | 2 +- src/router/index.ts | 6 ++ src/views/setting/message/index.vue | 140 ++++++++++++++++++++++++++++ 6 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 src/apis/system/message.ts create mode 100644 src/views/setting/message/index.vue diff --git a/src/apis/system/index.ts b/src/apis/system/index.ts index 27d9408..bbf216d 100644 --- a/src/apis/system/index.ts +++ b/src/apis/system/index.ts @@ -8,3 +8,4 @@ export * from './file' export * from './storage' export * from './option' export * from './user-center' +export * from './message' diff --git a/src/apis/system/message.ts b/src/apis/system/message.ts new file mode 100644 index 0000000..85bce64 --- /dev/null +++ b/src/apis/system/message.ts @@ -0,0 +1,19 @@ +import type * as System from './type' +import http from '@/utils/http' + +const BASE_URL = '/system/message' + +/** @desc 查询消息列表 */ +export function listMessage(query: System.MessagePageQuery) { + return http.get>(`${BASE_URL}`, query) +} + +/** @desc 删除消息 */ +export function deleteMessage(ids: string | Array) { + return http.del(`${BASE_URL}/${ids}`) +} + +/** @desc 标记已读 */ +export function readMessage(ids: string | Array) { + return http.patch(`${BASE_URL}/read`, ids) +} diff --git a/src/apis/system/type.ts b/src/apis/system/type.ts index 68e3f3c..395a9d9 100644 --- a/src/apis/system/type.ts +++ b/src/apis/system/type.ts @@ -297,3 +297,25 @@ export interface BindSocialAccountRes { source: string description: string } + +/** 系统消息类型 */ +export interface MessageResp { + id: string + title: string + content: string + type: number + isRead: boolean + readTime: string + createUserString: string + createTime: string +} + +export interface MessageQuery { + title?: string + type?: number + isRead?: boolean + sort: Array +} + +export interface MessagePageQuery extends MessageQuery, PageQuery { +} diff --git a/src/apis/system/user-center.ts b/src/apis/system/user-center.ts index 22a65e7..a80e084 100644 --- a/src/apis/system/user-center.ts +++ b/src/apis/system/user-center.ts @@ -1,5 +1,5 @@ +import type * as System from './type' import http from '@/utils/http' -import type * as System from '@/apis/system/type' const BASE_URL = '/system/user' diff --git a/src/router/index.ts b/src/router/index.ts index 4f813fb..931d223 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -63,6 +63,12 @@ export const constantRoutes: RouteRecordRaw[] = [ name: 'SettingProfile', component: () => import('@/views/setting/profile/index.vue'), meta: { title: '个人中心', showInTabs: false } + }, + { + path: '/setting/message', + name: 'SettingMessage', + component: () => import('@/views/setting/message/index.vue'), + meta: { title: '消息中心', showInTabs: false } } ] } diff --git a/src/views/setting/message/index.vue b/src/views/setting/message/index.vue new file mode 100644 index 0000000..eb19d45 --- /dev/null +++ b/src/views/setting/message/index.vue @@ -0,0 +1,140 @@ + + + + +