Skip to content

Commit

Permalink
Merge pull request #2704 from tangly1024/release/4.7.0
Browse files Browse the repository at this point in the history
支持配置验证后持续时长
  • Loading branch information
tangly1024 authored Sep 5, 2024
2 parents f1757c7 + 1b3dc6f commit 44ad994
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/OpenWrite.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ const OpenWrite = () => {
'OPEN_WRITE_BTN_TEXT',
'原创不易,完成人机检测,阅读全文'
)
// 验证一次后的有效时长,单位小时
const cookieAge = siteConfig('OPEN_WRITE_VALIDITY_DURATION', 1)
// 白名单
const whiteList = siteConfig('OPEN_WRITE_WHITE_LIST', '')

const loadOpenWrite = async () => {
const existWhite = existedWhiteList(router.asPath, whiteList)

// 如果当前页面在白名单中,则屏蔽加锁
if (existWhite) {
return
Expand All @@ -45,7 +48,8 @@ const OpenWrite = () => {
name,
btnText,
keyword,
blogId
blogId,
cookieAge
})
}
} catch (error) {
Expand Down

0 comments on commit 44ad994

Please sign in to comment.