更新优化换桌功能
This commit is contained in:
@@ -3,6 +3,7 @@ import { useUserStoreHook } from "@/store";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
|
||||
const user = useUserStoreHook();
|
||||
let isTips = false
|
||||
|
||||
export interface ApifoxModel {
|
||||
account: string;
|
||||
@@ -143,6 +144,7 @@ class WebSocketManager {
|
||||
this.autoConnect = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 自动重连机制
|
||||
private reconnect() {
|
||||
if (!this.autoConnect) {
|
||||
@@ -156,19 +158,24 @@ class WebSocketManager {
|
||||
}, this.reconnectDelay);
|
||||
} else {
|
||||
clearTimeout(this.reconnectTimer);
|
||||
console.error("达到最大重连次数,停止重连");
|
||||
ElMessageBox.confirm('达到最大重连次数' + this.maxReconnectAttempts + '次,已停止重连,是否立即重连?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
// window.location.reload();
|
||||
// console.error("达到最大重连次数,停止重连");
|
||||
if (!isTips) {
|
||||
ElMessageBox.confirm('达到最大重连次数' + this.maxReconnectAttempts + '次,已停止重连,是否立即重连?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
||||
callback: (action: string) => {
|
||||
console.log(action);
|
||||
if (action == 'confirm') {
|
||||
this.setupWebSocket();
|
||||
this.reconnectAttempts = 0;
|
||||
callback: (action: string) => {
|
||||
console.log(action);
|
||||
if (action == 'confirm') {
|
||||
isTips = false
|
||||
this.setupWebSocket();
|
||||
this.reconnectAttempts = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
isTips = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user