Fix FileImage
This commit is contained in:
@@ -5,6 +5,6 @@ import lombok.NoArgsConstructor;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public final class FileConstants {
|
public final class FileConstants {
|
||||||
|
|
||||||
public static final String FILE_API_PREFIX = "/file";
|
public static final String FILE_API_PREFIX = "/api/file";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,11 @@ public class FileController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(FILE_API_PREFIX + "/{resourceId}")
|
@GetMapping(FILE_API_PREFIX + "/{resourceId}")
|
||||||
|
public ResponseEntity<Resource> getFileApi(@PathVariable String resourceId) {
|
||||||
|
return ResponseEntity.ok(fileService.getFileAsResource(resourceId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/file/{resourceId}")
|
||||||
public ResponseEntity<Resource> getFile(@PathVariable String resourceId) {
|
public ResponseEntity<Resource> getFile(@PathVariable String resourceId) {
|
||||||
return ResponseEntity.ok(fileService.getFileAsResource(resourceId));
|
return ResponseEntity.ok(fileService.getFileAsResource(resourceId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ $(document).ready(function () {
|
|||||||
let editor
|
let editor
|
||||||
ClassicEditor.create(document.querySelector('#editor'), {
|
ClassicEditor.create(document.querySelector('#editor'), {
|
||||||
ckfinder: {
|
ckfinder: {
|
||||||
uploadUrl: '/file'
|
uploadUrl: '/api/file'
|
||||||
}}).then(newEditor => {
|
}}).then(newEditor => {
|
||||||
editor = newEditor;
|
editor = newEditor;
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
|||||||
Reference in New Issue
Block a user