update 完成消息盒子功能前后端联动(已读未读在前端浏览器存储)

This commit is contained in:
疯狂的狮子Li
2026-03-27 14:34:38 +08:00
parent 5907e4778b
commit ebc7760de2
10 changed files with 200 additions and 30 deletions

View File

@@ -53,10 +53,7 @@ export function register(data: any) {
*/
export function logout() {
closePush();
if (
import.meta.env.VITE_APP_MESSAGE_ENABLED === 'true'
&& import.meta.env.VITE_APP_MESSAGE_TRANSPORT.toLowerCase() !== 'websocket'
) {
if (import.meta.env.VITE_APP_MESSAGE_ENABLED === 'true' && import.meta.env.VITE_APP_MESSAGE_TRANSPORT.toLowerCase() === 'sse') {
request({
url: import.meta.env.VITE_APP_MESSAGE_PATH + '/close',
method: 'get'

View File

@@ -0,0 +1,10 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MessageBoxVO } from './types';
export function getMessageBox(): AxiosPromise<MessageBoxVO> {
return request({
url: '/system/message/box',
method: 'get'
});
}

View File

@@ -0,0 +1,17 @@
export interface MessageVO extends BaseEntity {
messageId: number | string;
category: string;
type: string;
source: string;
title: string;
message: string;
content?: string;
data?: Record<string, any> | null;
path?: string;
}
export interface MessageBoxVO {
systemList: MessageVO[];
noticeList: MessageVO[];
workflowList: MessageVO[];
}