wiki支持粘贴图片
This commit is contained in:
@@ -25,6 +25,8 @@ import java.io.InputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,6 +46,15 @@ public class WikiCommonController {
|
|||||||
@Resource
|
@Resource
|
||||||
WikiPageFileService wikiPageFileService;
|
WikiPageFileService wikiPageFileService;
|
||||||
|
|
||||||
|
@PostMapping("/wangEditor/upload")
|
||||||
|
public Map<String, Object> wangEditorUpload(WikiPageFile wikiPageFile, @RequestParam("files") MultipartFile file) {
|
||||||
|
this.upload(wikiPageFile, file);
|
||||||
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
|
resultMap.put("errno", "0");
|
||||||
|
resultMap.put("data", new String[]{wikiPageFile.getFileUrl()});
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/upload")
|
@PostMapping("/upload")
|
||||||
public ResponseJson<Object> upload(WikiPageFile wikiPageFile, @RequestParam("files") MultipartFile file) {
|
public ResponseJson<Object> upload(WikiPageFile wikiPageFile, @RequestParam("files") MultipartFile file) {
|
||||||
String fileName = file.getOriginalFilename();
|
String fileName = file.getOriginalFilename();
|
||||||
|
|||||||
@@ -784,8 +784,10 @@
|
|||||||
},
|
},
|
||||||
init(){
|
init(){
|
||||||
page.newPageContentEditor = new window.wangEditor('#newPageContentDiv');
|
page.newPageContentEditor = new window.wangEditor('#newPageContentDiv');
|
||||||
page.newPageContentEditor.customConfig.uploadImgServer = 'zyplayer-doc-wiki/common/upload';
|
page.newPageContentEditor.customConfig.uploadImgServer = 'zyplayer-doc-wiki/common/wangEditor/upload';
|
||||||
page.newPageContentEditor.customConfig.zIndex = 100;
|
page.newPageContentEditor.customConfig.zIndex = 100;
|
||||||
|
page.newPageContentEditor.customConfig.uploadFileName = 'files';
|
||||||
|
page.newPageContentEditor.customConfig.uploadImgMaxLength = 1;
|
||||||
page.newPageContentEditor.customConfig.pasteFilterStyle = false;
|
page.newPageContentEditor.customConfig.pasteFilterStyle = false;
|
||||||
page.newPageContentEditor.create();
|
page.newPageContentEditor.create();
|
||||||
this.createUrlParam();
|
this.createUrlParam();
|
||||||
|
|||||||
Reference in New Issue
Block a user