yukyo0821 3 gadi atpakaļ
vecāks
revīzija
e94f65c367
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      backstage/static/js/editor.js

+ 3 - 2
backstage/static/js/editor.js

@@ -101,6 +101,7 @@ axios.get(contentApiUrl).then(({ data }) => {
   //$("#sortable").sortable();
   //$("#sortable").disableSelection();
   $("#editor_block").css({ "display": "none" });
+  //alert(JSON.parse(document.getElementById('url').textContent).url);
 
   editor = new EditorJS({
     readOnly: false,
@@ -118,8 +119,8 @@ axios.get(contentApiUrl).then(({ data }) => {
         class: ImageTool,
         config: {
           endpoints: {
-            byFile: '/backstage/upload' + JSON.parse(document.getElementById('url').textContent).url, // Your backend file uploader endpoint
-            byUrl: '/backstage/getimage' + JSON.parse(document.getElementById('url').textContent).url, // Your endpoint that provides uploading by Url
+            byFile: '/backstage/upload' + JSON.parse(document.getElementById('url').textContent).url.substring(JSON.parse(document.getElementById('url').textContent).url.lastIndexOf('/')), // Your backend file uploader endpoint
+            byUrl: '/backstage/getimage' + JSON.parse(document.getElementById('url').textContent).url.substring(JSON.parse(document.getElementById('url').textContent).url.lastIndexOf('/')), // Your endpoint that provides uploading by Url
             /* byFile: '/backstage/upload/' + $('#ctitle').val(), // Your backend file uploader endpoint
             byUrl: '/backstage/getimage/' + $('#ctitle').val(), // Your endpoint that provides uploading by Url */
           }