|
@@ -888,9 +888,12 @@ const mockStart = async (state: boolean = false) => {
|
|
|
},
|
|
|
];
|
|
|
xAxisData.value = [];
|
|
|
- wsMockClient.connect();
|
|
|
- // 向服务器发送消息
|
|
|
- wsMockClient.send("你好!");
|
|
|
+
|
|
|
+ if (wsMockClient.readyState === WebSocket.CLOSED) {
|
|
|
+ wsMockClient.connect();
|
|
|
+ // 向服务器发送消息
|
|
|
+ wsMockClient.send("你好!");
|
|
|
+ }
|
|
|
|
|
|
handleDateRangeChange({
|
|
|
start: queryParamsMock.value.sDate,
|
|
@@ -1019,7 +1022,7 @@ const saveAttr = () => {
|
|
|
showModal.value = false;
|
|
|
}
|
|
|
onUnmounted(() => {
|
|
|
- wsMockClient.onClose();
|
|
|
+ wsMockClient.close();
|
|
|
});
|
|
|
// 获取警告提示
|
|
|
const getTip = () => {
|