mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-20 08:06:39 +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);
|
|
}
|
|
|
|
|