From 78053dac34f2cb87dad5d724c148b69f987e1616 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 20 Nov 2024 17:39:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=87=E8=AE=B0=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E5=8A=A0=E8=BD=BDjs=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/am/audio.vue | 3 ++- src/views/am/monitor.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/am/audio.vue b/src/views/am/audio.vue index f5658919..39872f70 100644 --- a/src/views/am/audio.vue +++ b/src/views/am/audio.vue @@ -91,7 +91,8 @@ export default { mounted(){ let that = this; let host = window.location.host; - let jsUrl = host.indexOf('localhost')>-1?'http://222.222.144.147:6013/jsmap/jsmap.js':host+'/jsmap/jsmap.js'; + let jsUrl = host.indexOf('localhost')>-1?'http://222.222.144.147:6013/jsmap/jsmap.js':window.location.protocol + "//" + host+'/jsmap/jsmap.js'; + console.log(jsUrl) that.loadScript('mapId',jsUrl, () => { that.canUseMap = true; }) diff --git a/src/views/am/monitor.vue b/src/views/am/monitor.vue index 5f70cbcd..823e9e89 100644 --- a/src/views/am/monitor.vue +++ b/src/views/am/monitor.vue @@ -154,7 +154,7 @@ export default { this.getArea(); let that = this; let host = window.location.host; - let jsUrl = host.indexOf('localhost') > -1 ? 'http://222.222.144.147:6013/jsmap/jsmap.js' : host + '/jsmap/jsmap.js'; + let jsUrl = host.indexOf('localhost') > -1 ? 'http://222.222.144.147:6013/jsmap/jsmap.js' : window.location.protocol + "//" + host+'/jsmap/jsmap.js'; that.loadScript('mapId', jsUrl, () => { that.canUseMap = true; })