From 87b66e9f4483ed498af2c1b537a3078d310b3672 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Sun, 28 Apr 2024 15:45:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8DGlobal=5FJS=20=E4=B8=8D?= =?UTF-8?q?=E8=A2=AB=E6=89=A7=E8=A1=8C=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ExternalPlugins.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/components/ExternalPlugins.js b/components/ExternalPlugins.js index 01622753..b77f960d 100644 --- a/components/ExternalPlugins.js +++ b/components/ExternalPlugins.js @@ -152,12 +152,16 @@ const ExternalPlugin = props => { } useEffect(() => { + // 异步渲染谷歌广告 if (ADSENSE_GOOGLE_ID) { setTimeout(() => { - // 异步渲染谷歌广告 initGoogleAdsense() }, 1000) } + + // 执行注入脚本 + // eslint-disable-next-line no-eval + eval(GLOBAL_JS) }, []) if (DISABLE_PLUGIN) { @@ -206,16 +210,6 @@ const ExternalPlugin = props => { )} - {/* 注入JS脚本 */} - {GLOBAL_JS && ( -