From 0da72787fae91aa42a250101bd932c08948705bf Mon Sep 17 00:00:00 2001 From: Windsland52 <86581225+Windsland52@users.noreply.github.com> Date: Wed, 30 Jul 2025 08:27:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(gitalk):=20=E4=BF=AE=E5=A4=8D=20MD5=20?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=AF=BC=E8=87=B4=E7=9A=84=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E8=81=9A=E5=90=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 url_for 调用添加 {relative: false} 参数 - 解决空字符串 MD5 导致多页面评论混合的问题 --- scripts/helpers/page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/helpers/page.js b/scripts/helpers/page.js index 9cdee3f..8d7c226 100644 --- a/scripts/helpers/page.js +++ b/scripts/helpers/page.js @@ -48,7 +48,7 @@ hexo.extend.helper.register('urlNoIndex', function (url = null, trailingIndex = }) hexo.extend.helper.register('md5', function (path) { - return crypto.createHash('md5').update(decodeURI(this.url_for(path))).digest('hex') + return crypto.createHash('md5').update(decodeURI(this.url_for(path, {relative: false}))).digest('hex') }) hexo.extend.helper.register('injectHtml', data => {