|
@@ -167,7 +167,11 @@ const doingExport = ref(false)
|
|
|
const exportProgress = ref(0)
|
|
|
const exportUrl = ref(null)
|
|
|
// const wsUrl = 'ws://localhost:8081/wsExport/'
|
|
|
-const wsUrl = import.meta.env.VITE_WS_EXPORT_API
|
|
|
+const innetUrl = import.meta.env.VITE_WS_INNET_EXPORT_API
|
|
|
+const outnetUrl = import.meta.env.VITE_WS_OUTNET_EXPORT_API
|
|
|
+const hostIp = import.meta.env.VITE_HOST_IP;
|
|
|
+
|
|
|
+// const wsUrl = import.meta.env.VITE_WS_EXPORT_API
|
|
|
let ws = null
|
|
|
|
|
|
const webHost = import.meta.env.VITE_APP_BASE_API;
|
|
@@ -382,6 +386,13 @@ async function createWebSocket(id, token) {
|
|
|
try {
|
|
|
// const options = { headers: { Authorization: 'Bearer ' + token } }
|
|
|
// console.log(options)
|
|
|
+ var itemUrl = document.location.origin;
|
|
|
+ var wsUrl = "";
|
|
|
+ if (itemUrl.includes(hostIp)) {
|
|
|
+ wsUrl = innetUrl;
|
|
|
+ } else {
|
|
|
+ wsUrl = outnetUrl;
|
|
|
+ }
|
|
|
ws = new WebSocket(wsUrl + id, [token])
|
|
|
} catch (e) {
|
|
|
console.log(e)
|