解决页面切换页面导致评论路由不对,没有评论数据

This commit is contained in:
1152958806@qq.com 2023-10-19 14:26:59 +08:00
parent cc2317c2e4
commit 41614091a7
4 changed files with 4 additions and 3 deletions

View File

@ -6,7 +6,7 @@
el: '#artalk-wrap',
server: GLOBAL_CONFIG.source.artalk.artalkUrl,
site: GLOBAL_CONFIG.source.artalk.siteName,
pageKey: location.pathname,
pageKey: location.pathname.replace(/\/page\/\d$/, ""),
darkMode: false,
countEl: '#ArtalkCount'
}, null))

View File

@ -5,6 +5,7 @@
el: '#twikoo-wrap',
envId: GLOBAL_CONFIG.source.twikoo.twikooUrl,
region: '',
path: location.pathname.replace(/\/page\/\d$/, ""),
onCommentLoaded: function () {
btf.loadLightbox(document.querySelectorAll('#twikoo .tk-content img:not(.tk-owo-emotion)'))
typeof hljs === 'object' && hljs.highlightAll()

View File

@ -6,7 +6,7 @@
serverURL: GLOBAL_CONFIG.source.waline.serverURL,
pageview: false,
dark: 'html[data-theme="dark"]',
path: window.location.pathname,
path: window.location.pathname.replace(/\/page\/\d$/, ""),
comment: false,
locale:GLOBAL_CONFIG.source.waline.locale
}, null))

View File

@ -12,7 +12,7 @@ if(GLOBAL_CONFIG.htmlType!='comments' && document.querySelector('#post-comment')
//token获取见上方
accessToken: GLOBAL_CONFIG.source.twikoo.accessToken,
mailMd5: GLOBAL_CONFIG.source.comments.mailMd5,
pageUrl: window.location.pathname,
pageUrl: window.location.pathname.replace(/\/page\/\d$/, ""),
barrageTimer: [],
barrageList: [],
siteName: GLOBAL_CONFIG.source.artalk.siteName,