Skip to content

Commit

Permalink
fix(artalk): imageUploader (#782)
Browse files Browse the repository at this point in the history
  • Loading branch information
penndu committed Jul 2, 2022
1 parent 0a929b9 commit c573d0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions layout/_plugins/comments/artalk/script.ejs
Expand Up @@ -31,17 +31,17 @@
imgUploader: function(file) {
let headers = new Headers();
headers.set('Accept', 'application/json');
<% if(!!theme.comments.artalk.imgUploader?.token) { %>
headers.set('Authorization', '<%= theme.comments.artalk.imgUploader?.token %>')
<% if(!!theme.comments.artalk.imageUploader?.token) { %>
headers.set('Authorization', '<%= theme.comments.artalk.imageUploader?.token %>')
<% } %>
let formData = new FormData();
formData.append('file', file);
return fetch('<%= theme.comments.artalk.imgUploader?.api %>',{
return fetch('<%= theme.comments.artalk.imageUploader?.api %>',{
method: 'POST',
body: formData,
headers: headers
}).then((resp) => resp.json())
.then((resp) => resp.<%= theme.comments.artalk.imgUploader?.resp %>)
.then((resp) => resp.<%= theme.comments.artalk.imageUploader?.resp %>)
},
<% } %>
}));
Expand Down

0 comments on commit c573d0c

Please sign in to comment.