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) {