不蒜子调整
This commit is contained in:
tangly1024
2021-12-21 13:55:42 +08:00
parent e430d55cf8
commit ac7ff2e912
7 changed files with 153 additions and 47 deletions

View File

@@ -2,7 +2,6 @@ import lang from './lang'
import { useContext, createContext, useState, useEffect } from 'react'
import cookie from 'react-cookies'
import Router from 'next/router'
const GlobalContext = createContext()
/**
@@ -104,28 +103,6 @@ const initTheme = (theme, changeTheme) => {
}
}
export function handleRouteChange (url) {
initGoogleAdsense()
}
/**
* 初始化谷歌广告
*/
function initGoogleAdsense () {
const ads = document.getElementsByClassName('adsbygoogle').length
const newAdsCount = ads
if (newAdsCount > 0) {
for (let i = 0; i <= newAdsCount; i++) {
try {
// eslint-disable-next-line no-undef
(adsbygoogle = window.adsbygoogle || []).push({})
} catch (e) {
}
}
}
}
/**
* 读取默认主题
* @returns {*}