优化小票打印

This commit is contained in:
gyq
2024-07-31 18:14:23 +08:00
parent 49cabfed21
commit f393299f0f
11 changed files with 88 additions and 161 deletions

View File

@@ -57,7 +57,14 @@ export const useSocket = defineStore({
if (this.ws == null) {
console.log("创建新的ws连接");
this.ws = new ReconnectingWebSocket(wsUrl);
const protocols = []; // 可选的子协议数组
const options = {
// 自动重新连接的选项(可选)
connectionTimeout: 1000,
maxRetries: 100,
};
this.ws = new ReconnectingWebSocket(wsUrl, protocols, options);
} else {
console.log("重新连接ws");
this.wsReconnect();