mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-05-01 13:39:29 +08:00
21 lines
455 B
JavaScript
21 lines
455 B
JavaScript
|
|
import signalR from "@/utils/signalR";
|
||
|
|
import useNoticeStore from "@/stores/notice";
|
||
|
|
import { dayjs } from 'element-plus'
|
||
|
|
const receiveMsg=(connection)=> {
|
||
|
|
|
||
|
|
const noticeStore = useNoticeStore();
|
||
|
|
connection.on("Personal", (message) => {
|
||
|
|
noticeStore.addNotice({
|
||
|
|
message:message,
|
||
|
|
isRead:false,
|
||
|
|
creationTime:dayjs().format()
|
||
|
|
});
|
||
|
|
});
|
||
|
|
};
|
||
|
|
|
||
|
|
export default ()=>{
|
||
|
|
signalR.start(`bbs-notice`,receiveMsg);
|
||
|
|
}
|
||
|
|
|
||
|
|
|