diff --git a/.env.local b/.env.local index 1283ba60..f1644143 100644 --- a/.env.local +++ b/.env.local @@ -1,2 +1,2 @@ # 环境变量 @see https://www.nextjs.cn/docs/basic-features/environment-variables -NEXT_PUBLIC_VERSION=4.0.0 \ No newline at end of file +NEXT_PUBLIC_VERSION=4.0.5 \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 4b95adcd..bab5ea27 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -26,6 +26,7 @@ module.exports = { } }, rules: { + 'react/no-unknown-property': 'off', // + + ) +} diff --git a/components/GoogleAdsense.js b/components/GoogleAdsense.js index d9718369..9cdaa406 100644 --- a/components/GoogleAdsense.js +++ b/components/GoogleAdsense.js @@ -1,4 +1,5 @@ import BLOG from '@/blog.config' +import { loadExternalResource } from '@/lib/utils' import { useRouter } from 'next/router' import { useEffect } from 'react' @@ -8,25 +9,35 @@ import { useEffect } from 'react' */ export default function GoogleAdsense() { const initGoogleAdsense = () => { - setTimeout(() => { - const ads = document.getElementsByClassName('adsbygoogle') - const adsbygoogle = window.adsbygoogle - if (ads.length > 0) { - for (let i = 0; i <= ads.length; i++) { - try { - adsbygoogle.push(ads[i]) - console.log('adsbygoogle', i, ads[i], adsbygoogle) - } catch (e) { + // GoogleAdsense 本地开发请加入 data-adbreak-test="on" + // {BLOG.ADSENSE_GOOGLE_ID &&