兰宝车间质量管理系统-前端
疯狂的狮子Li
2024-05-20 a63543a5c793c8954fa2f9da0ee4fb215c62d8c2
src/utils/websocket.ts
@@ -19,10 +19,8 @@
 */
import { getToken } from '@/utils/auth';
import { ElNotification } from 'element-plus';
import useNoticeStore from '@/store/modules/notice';
import { ElNotification } from "element-plus";
const { addNotice } = useNoticeStore();
let socketUrl: any = ''; // socket地址
let websocket: any = null; // websocket 实例
@@ -125,7 +123,7 @@
    if (e.data.indexOf('ping') > 0) {
      return;
    }
    addNotice({
    useNoticeStore().addNotice({
      message: e.data,
      read: false,
      time: new Date().toLocaleString()
@@ -135,7 +133,7 @@
      message: e.data,
      type: 'success',
      duration: 3000
    })
    });
    return e.data;
  };
};