Update artalk.pug

This commit is contained in:
Jerry Wong 2023-04-30 18:05:52 +08:00 committed by GitHub
parent 096973ecce
commit 0342df6ed7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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