springboot ueditor 集成 ueditor-spring-boot-starter

!ueditor-spring-boot-starter

項目地址:https://github.com/weiangongsi/ueditor.git

集成的時候對源碼稍有改動,改動信息如下

1. com.baidu.ueditor.define.MultiState 修改 第86行(Json)

2. com.baidu.ueditor.upload.BinaryUploader 修改了 save方法(圖片上傳)

3. com.baidu.ueditor.hunter.FileManager 修改了 listFile方法(圖片列表)

由於沒有支持jsp再寫一個controller

@RequestMapping("/ueditor")
    @ResponseBody
    public String ueditor(HttpServletRequest request) {
        return new ActionEnter(request, rootPath).exec();
    }

ueditor.config.js

// 服務器統一請求接口路徑
        , serverUrl: "/ueditor"

ueditor-spring-boot-starter

項目地址:https://github.com/weiangongsi/ueditor-spring-boot-starter.git

這是在上面那個項目的基礎上改的

打開此項目執行install,然後你自己的項目

或者直接下載jar包

網盤地址:https://pan.baidu.com/s/1iWmIacELEuhvN7NWjtd9xg

pom文件中引入

<dependency>
  <groupId>com.baidu</groupId>
  <artifactId>ueditor-spring-boot-starter</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</dependency>

把下載的ueditor文件放到 resource/static目錄下


application.yml

ue:
  root-path: src/main/resources/static/ueditor/jsp
  server-url: /ueditor
  url-prefix: /files

root-path:config.json 路徑(config.js中的**PathFormat相對應)

server-url:ueditor服務器統一請求接口路徑(ueditor.config.js 中的 serverUrl)

url-prefix:資源訪問前綴(config.js中的**UrlPrefix相對應)

我們上傳圖片也可以調用ueditor實現上傳

/server-url?action=uploadimage

查看圖片列表

/server-url?action=listimage&start=0&size=20

參數說明:start爲第幾條開始size爲條數


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章