# ueditor-spring-boot-starter-example
**Repository Path**: jerryjin0630/ueditor-spring-boot-starter-example
## Basic Information
- **Project Name**: ueditor-spring-boot-starter-example
- **Description**: springboot 与百度编辑器 ueditor 整合。上传图片功能正常
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-03-15
- **Last Updated**: 2021-11-03
## Categories & Tags
**Categories**: Uncategorized
**Tags**: example, GitHub
## README
# ueditor-spring-boot-starter
##### 支持上传到 本地、七牛云
1. #### 文件导入
* 新建springboot项目
* 不需要下载本项目,jar包已经上传到maven仓库
* pom文件引入
```
* 创建ueditor目录 resources > static > ueditor ,将源码拷贝到目录中
* jsp目录只保留 config.json 文件即可
* 或者直接使用本项目中的文件
##### 目录结构
├── resources
│ ├── static
│ │ ├── ueditor
│ │ │ ├── dialogs
│ │ │ ├── jsp
│ │ │ │ └── config.json
│ │ │ ├── lang
│ │ │ ├── themes
│ │ │ ├── ueditor.all.js
│ │ │ ├── ueditor.config.js
│ │ │ ├── ueditor.parse.js
│ │ │ └── third-party
2. #### 项目配置
* application.yml
```application.yml
ue:
config-file: static/ueditor/jsp/config.json #resources目录下配置文件的位置
server-url: /ueditor.do #服务器统一请求接口路径
local: #上传到本地配置
url-prefix: /file/ #"/"结尾 自定义上传时字段无意义
physical-path: C:/upload/ #存储文件的绝对路径 必须使用标准路径"/"作为分隔符 自定义上传时字段无意义
qiniu: #上传到七牛云配置 参数对应官方文档 https://developer.qiniu.com/kodo/sdk/1239/java
accessKey: ---
secretKey: ---
cdn: https://--- #融合 CDN 加速域名
bucket: ---
zone: zone0
```
* static/ueditor/ueditor.config.js
将serverUrl 改为application.yml 中server.servlet.context-path(如果你设置了此值则加上) + ue.server-url 的值
* config.json
注意:图片访问路径前缀(imageUrlPrefix)、视频访问路径前缀、文件访问路径前缀不要赋值,会影响回显,其余参数可以按照百度文档修改
* 上传文件大小
spring上传文件默认最大1MB,上传文件大小会先被spring限制,config.json文件大小限制要小于spring的设置,我们可以将spring的限制设大点
```
spring:
servlet:
multipart:
max-file-size: 500MB
max-request-size: 500MB
```
3. #### 测试
* 新建Controller 添加mapping
```
@GetMapping("/")
public String index() {
return "ue";
}
```
* 在templates下新建页面ue.html
```ue.html