Merge branch 'dev' into future/flowable

This commit is contained in:
gssong 2023-11-02 21:43:22 +08:00
commit eec541d0e4
2 changed files with 11 additions and 6 deletions

View File

@ -115,18 +115,23 @@ export const sendMsg = (data: any) => {
// socket 接收数据
export const websocketonmessage = () => {
websocket.onmessage = function (e: any) {
const msg = JSON.parse(e.data) as any;
if (msg.type === 'heartbeat') {
if (e.data.indexOf('heartbeat') > 0) {
resetHeart();
}
if (msg.type === 'ping') {
if (e.data.indexOf('ping') > 0) {
return;
}
addNotice({
message: msg,
message: e.data,
read: false,
time: new Date().toLocaleString()
});
return msg;
ElNotification({
title: '消息',
message: e.data,
type: 'success',
duration: 3000
})
return e.data;
};
};

View File

@ -95,7 +95,7 @@
import { initWebSocket } from '@/utils/websocket';
onMounted(() => {
initWebSocket("ws://"+window.location.host+import.meta.env.VITE_APP_BASE_API+"/resource/websocket");
initWebSocket("ws://" + window.location.host + import.meta.env.VITE_APP_BASE_API + "/resource/websocket");
});
const goTarget = (url:string) => {