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

View File

@@ -20,6 +20,13 @@ const AuthAPI = {
}, },
// 新增 // 新增
addunit(data: any) { 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>({ return request<any, Responseres>({
url: `${baseURL}`, url: `${baseURL}`,
method: "post", method: "post",

View File

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