首先下载源码,对源码修改后再打成jar包,替换原jar包
ueditor最终上传路径是rootPath(项目路径) + savePath(config.json中的filePathFormat),所以只要修改最终上传路径即可
a、修改最终上传路径中获取rootPath 为 获取自定义参数saveRootPath
b、修改最终上传路径中savePath的值,即重新设置config.json中的filePathFormat
红色标记的为修改的
1、修改ActionEnter.java
public ActionEnter ( HttpServletRequest request, String rootPath ) {
this.request = request;
this.rootPath = rootPath;
this.actionType = request.getParameter( "action" );
this.contextPath = request.getContextPath();
this.configManager = ConfigManager.getInstance( this.rootPath, this.contextPath, request.getRequestURI() );
//添加下方法,customJson参数由前台传入,自定义上传路径关键
//customJson中包含saveRootPath