From 75ab796a099d3a720603ae8126ebe3ed1bcd7474 Mon Sep 17 00:00:00 2001 From: liutao <790864623@qq.com> Date: Fri, 12 Jun 2026 11:37:12 +0800 Subject: [PATCH] update --- src/views/mes/printconfig/index.vue | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/views/mes/printconfig/index.vue b/src/views/mes/printconfig/index.vue index bb10d7cd..a0ed49b0 100644 --- a/src/views/mes/printconfig/index.vue +++ b/src/views/mes/printconfig/index.vue @@ -166,7 +166,7 @@ const queryParams = reactive({ const queryFormRef = ref() // 搜索的表单 const exportLoading = ref(false) // 导出的加载中 const clientHostStorageKey = 'hiprint-client-host' -const defaultClientHost = 'http://127.0.0.1:17521' +const defaultClientHost = 'http://localhost:17521' let hiprintInited = false @@ -190,6 +190,24 @@ const ensureHiprintInit = () => { if (hiprintInited) { return } + + // Edge ���ݣ�Ϊ hiwebSocket ���?polling ����㽵��? // ԭ���������?transports:["websocket"]��Edge ��ȫ������ WebSocket ��������ʧ�� + const socket = getHiwebSocket() + if (socket?.start && !socket.__transportPatched) { + const originalStart = socket.start.bind(socket) + socket.start = function (callback?: any) { + const originalIo = window.io + window.io = function (url: string, opts?: any) { + opts = opts || {} + opts.transports = ['websocket', 'polling'] + return originalIo(url, opts) + } + originalStart(callback) + window.io = originalIo + } + socket.__transportPatched = true + } + hiprint.init({ host: normalizeClientHost(), providers: [defaultElementTypeProvider()]