This commit is contained in:
YeMingfei666 2025-04-07 16:21:56 +08:00
commit b1d175b108
2 changed files with 10 additions and 3 deletions

View File

@ -20,6 +20,13 @@ const AuthAPI = {
},
// 新增
addunit(data: any) {
console.log(data, '提示121');
if (data.images.length == 0) {
data.images = null
}
if (data.proGroupVo.length == 0) {
data.proGroupVo = null
}
return request<any, Responseres>({
url: `${baseURL}`,
method: "post",

View File

@ -59,7 +59,7 @@ class WebSocketManager {
this.sendMessage(this.initParams);
this.clearTimer();
this.timer = setInterval(() => {
this.sendMessage({ type: "ping_interval", set: 'manage' });
this.sendMessage({ type: "ping_interval", set: 'manage' }, false);
}, 1000 * 10);
};
@ -108,7 +108,7 @@ class WebSocketManager {
this.autoConnect = true
}
public sendMessage(message: any) {
public sendMessage(message: any, isSendInitParams: boolean = true) {
if (!this.client || !this.connected) {
// ElMessage.error('发送失败,已重新连接,请重新操作');
this.reconnect();
@ -118,7 +118,7 @@ class WebSocketManager {
this.disconnect();
return
}
const msg = JSON.stringify({ ...this.initParams, ...message });
const msg = JSON.stringify(isSendInitParams ? { ...this.initParams, ...message } : message);
try {
this.client?.send(msg);
} catch (error) {