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; })