Ver código fonte

change the way getting content, due to api return change

weichen 4 anos atrás
pai
commit
f0d6e82e6d
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      backstage/static/js/editor.js

+ 1 - 1
backstage/static/js/editor.js

@@ -17,7 +17,7 @@ const titleButton = document.getElementById('title_button');
 const submitButton = document.getElementById('submit_button');
 const contentApiUrl = `${PORTAL_SERVER}contents?url=${(JSON.parse(document.getElementById('url').textContent)).url}`
 axios.get(contentApiUrl).then(({ data }) => {
-  const content = _.get(data, 'content', '');
+  const content = _.get(data, '0.content', '');
   const url = 'http://localhost:1313' + (JSON.parse(document.getElementById('url').textContent)).url + '/';
   var {frontMatters, blockArray, blockCount} = parseMd(content)
   var dataIndex;