From 096973eccebcc01544330f2fe03eb446c36260d0 Mon Sep 17 00:00:00 2001 From: nite07 Date: Wed, 26 Apr 2023 12:58:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Artalk=20=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=8E=B7=E5=8F=96=E6=9C=80=E6=96=B0=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../includes/third-party/newest-comments/artalk.pug | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/layout/includes/third-party/newest-comments/artalk.pug b/layout/includes/third-party/newest-comments/artalk.pug index 8940275..2e65c30 100644 --- a/layout/includes/third-party/newest-comments/artalk.pug +++ b/layout/includes/third-party/newest-comments/artalk.pug @@ -53,7 +53,16 @@ script. } const getComment = () => { - fetch('!{server}/api/stat?type=latest_comments&limit=!{theme.newest_comments.limit}&site_name=!{site}', headerList) + fetch('!{server}/api/stat', Object.assign({ + headers:{ + 'Content-Type': 'application/x-www-form-urlencoded' + }, + body: new URLSearchParams({ + 'site_name': '!{site}', + 'limit': '!{theme.newest_comments.limit}', + 'type':'latest_comments' + }) + }, headerList)) .then(response => response.json()) .then(d => { const artalk = d.data.map(function (e) { From 0342df6ed707eb090f6d360e6c9e9a7e01397b66 Mon Sep 17 00:00:00 2001 From: Jerry Wong Date: Sun, 30 Apr 2023 18:05:52 +0800 Subject: [PATCH 2/2] Update artalk.pug --- .../third-party/newest-comments/artalk.pug | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/layout/includes/third-party/newest-comments/artalk.pug b/layout/includes/third-party/newest-comments/artalk.pug index 2e65c30..68037b0 100644 --- a/layout/includes/third-party/newest-comments/artalk.pug +++ b/layout/includes/third-party/newest-comments/artalk.pug @@ -48,21 +48,18 @@ script. const headerList = { method: 'POST', headers: { + 'Content-Type': 'application/x-www-form-urlencoded', 'Origin': window.location.origin - } + }, + body: new URLSearchParams({ + 'site_name': '!{site}', + 'limit': '!{theme.newest_comments.limit}', + 'type':'latest_comments' + }) } const getComment = () => { - fetch('!{server}/api/stat', Object.assign({ - headers:{ - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body: new URLSearchParams({ - 'site_name': '!{site}', - 'limit': '!{theme.newest_comments.limit}', - 'type':'latest_comments' - }) - }, headerList)) + fetch('!{server}/api/stat', headerList) .then(response => response.json()) .then(d => { const artalk = d.data.map(function (e) {