# index **Repository Path**: GntLee/index ## Basic Information - **Project Name**: index - **Description**: Grails3集成百度ueditor富文本实现图片上传 - **Primary Language**: Groovy - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 1 - **Created**: 2017-07-12 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 本项目主要集成Grails3+gradle2.9+jdk1.8+ueditor: #### 主要实现: * 富文本点击文件上传 ### 实现思路: 重写com.baidu.ueditor.ConfigManager 和com.baidu.ueditor.upload.BinaryUploader覆盖默认的类和方法 ### 说明:百度`ueditor`下载下来后先将`lib`下面的`json.jar`和`ueditor.jar`导入项目,发现用不了,页面`console`出现错误日志,此问题是因为`ueditor.jar`中的类无法加载到`config.json`配置文件,所有我的思路就是重写`ueditor`里面的类。 1、项目下面创建`libs`目录,`build.gradle`中`dependencies`中引入 ```bash compile fileTree(dir: 'libs', includes: ['*.jar']) ``` 2、将次项目中`src/groovy`中的文件拷贝到你自己项目的`src/groovy`下面 3、复制`src/main/resources`下面的`config.json`到你项目下面,没有请创建 > 效果图 ![](QQ截图20190103184249.png) # upgrade 说明 * 新增文件上传路径配置,配置文件位于:`grails-app/conf/application-file.yaml`中,在`application.yml`中引入 * 配置文件中的绝对路径和相对路径应注意 * 绝对路径可以不管 * 相对路径,比如`/upload/**`,表示访问的时候url地址为:`http://domain.com/upload/xxx.txt`,此时需要注意配置`config.json`的前缀中必须包含:`/upload/`,如:前缀为:`http://localhost:8080/upload` * 使用文件上传的时候注意修改`src/main/resources/config.json`中的配置 * 注意修改配置文件中的`imageUrlPrefix`访问前缀