# thirdparty
**Repository Path**: f1818/thirdparty
## Basic Information
- **Project Name**: thirdparty
- **Description**: 第三方项目
- **Primary Language**: Java
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 7
- **Created**: 2025-03-13
- **Last Updated**: 2025-03-13
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
我在ueditor里面提供了一个接口IStorageManager
这样Ueditor与任何实际的文件存储方式都可以组合
``` java
// 只需要继承IStorageManager并实现这两个方法:
// saveBinaryFile, saveFileByInputStream
FileStoreUeditorUploader implements IStorageManager {
// 存储到服务器某个目录
}
FastdfsUeditorUploader implements IStorageManager {
// 存储到FastDFS
}
AliyunUeditorUploader implements IStorageManager {
// 存储到阿里云
}
```
然后建一个UeditorController
``` java
@Controller
@RequestMapping("actions/common/ueditor")
public class UeditorController {
@Autowired
private IStorageManager uploader; // 在spring.xml文件中根据项目实际情况加载具体的实现类
@RequestMapping("upload")
public void upload(HttpServletRequest request, HttpServletResponse response) throws Exception {
request.setCharacterEncoding("UTF-8");
response.setHeader("Content-Type", "text/html");
String rootPath = request.getServletContext().getRealPath("/");
response.getWriter().write(new ActionEnter(uploader, request, rootPath).exec());
}
}
```
在公共JS中修改ueditor的上传地址
``` javascript
window.UEDITOR_CONFIG.serverUrl = "actions/common/ueditor/upload?configPath=assets/libs/ueditor/jsp/config.json";
```
在spring.xml文件中根据项目实际情况加载具体的实现类
``` xml
```
ueditor maven repository
``` xml
com.gitee.qdbp.thirdparty
ueditor
1.4.3.4
```