From 1c466465de20082087575ea375e8c05976936a33 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Wed, 23 Jun 2021 16:54:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=87=92=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E9=87=8D=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/_partial/scripts/index.ejs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/layout/_partial/scripts/index.ejs b/layout/_partial/scripts/index.ejs index 4cd90bb..adc4416 100644 --- a/layout/_partial/scripts/index.ejs +++ b/layout/_partial/scripts/index.ejs @@ -61,6 +61,11 @@ // 从 butterfly 和 volantis 获得灵感 loadScript: (src, opt) => new Promise((resolve, reject) => { + // 判断是否存在 + let el = document.querySelector("script[src='" + src + "']") + if (el !== null) { + return + } var script = document.createElement('script') script.src = src if (opt) {