From 2e5bdc23ed11f40055d5836cdee6f8c917536a4d Mon Sep 17 00:00:00 2001 From: jiweiyang <957703771@qq.com> Date: Tue, 17 Aug 2021 16:40:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9getStaticUrl=E4=B8=AD?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5http=E8=BD=AChttps=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index ed7966f..d3eee7f 100755 --- a/src/main.js +++ b/src/main.js @@ -59,7 +59,7 @@ Vue.prototype.global = { Vue.prototype.isDarkModel = false; /** * @description: 更改暗黑模式 - * @param {bool} 是否启动暗黑模式 + * @param {bool} 是否启动暗黑模式 * @return {null} */ Vue.prototype.changeDarkModel = function (enabled) { @@ -95,7 +95,10 @@ Vue.prototype.getStaticUrl = function (url) { if (!url) { url = ""; } - url = this.http2https(url.toString()); + const isHttps = 'https:' == document.location.protocol ? true : false; + if (isHttps) { + url = this.http2https(url.toString()); + } if (url.indexOf('http://') == 0 || url.indexOf("https://") == 0) { return url; } else { @@ -204,4 +207,4 @@ Vue.use(vuePhotoPreview, {}); new Vue({ el: '#app', render: c => c(App), -}); \ No newline at end of file +}); -- Gitee