feat: 新增页面防复制功能

This commit is contained in:
LooseLi
2023-08-01 18:20:12 +08:00
parent f60af40459
commit 86fd5adf59
14 changed files with 80 additions and 0 deletions

View File

@@ -29,6 +29,13 @@ export function GlobalContextProvider(props) {
initTheme()
}, [])
// 是否允许复制页面内容
useEffect(() => {
if (!BLOG.CAN_COPY) {
document.getElementsByTagName('html')[0].classList.add('forbid-copy')
}
}, [])
useEffect(() => {
const handleStart = (url) => {
NProgress.start()