Explorar el Código

文件上传,以及富文本插件优化修改

liubo hace 3 años
padre
commit
836ad11f93

+ 0 - 48
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/utils/IpUtil.java

@@ -1,48 +0,0 @@
-package com.zd.alg.iot.vmp.utils;
-
-
-import javax.servlet.http.HttpServletRequest;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-public class IpUtil {
-    public static String getIpAddr(HttpServletRequest request) {
-        String ipAddress = null;
-        try {
-            ipAddress = request.getHeader("x-forwarded-for");
-            if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
-                ipAddress = request.getHeader("Proxy-Client-IP");
-            }
-            if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
-                ipAddress = request.getHeader("WL-Proxy-Client-IP");
-            }
-            if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
-                ipAddress = request.getRemoteAddr();
-                if (ipAddress.equals("127.0.0.1")) {
-                    // 根据网卡取本机配置的IP
-                    InetAddress inet = null;
-                    try {
-                        inet = InetAddress.getLocalHost();
-                    } catch (UnknownHostException e) {
-                        e.printStackTrace();
-                    }
-                    ipAddress = inet.getHostAddress();
-                }
-            }
-            // 对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割
-            if (ipAddress != null && ipAddress.length() > 15) { // "***.***.***.***".length()
-                // = 15
-                if (ipAddress.indexOf(",") > 0) {
-                    ipAddress = ipAddress.substring(0, ipAddress.indexOf(","));
-                }
-            }
-        } catch (Exception e) {
-            ipAddress="";
-        }
-        // ipAddress = this.getRequest().getRemoteAddr();
-
-        return ipAddress;
-    }
-}
-
-

+ 5 - 23
zd-modules/zd-base/src/main/java/com/zd/base/files/bigupload/service/impl/UploadServiceImpl.java

@@ -7,10 +7,10 @@ import com.zd.base.files.bigupload.response.error.BusinessErrorCode;
 import com.zd.base.files.bigupload.response.error.BusinessException;
 import com.zd.base.files.bigupload.service.IUploadService;
 import com.zd.base.files.bigupload.utils.FileUtils;
+import com.zd.base.files.file.config.ResourcesConfig;
 import org.apache.tomcat.util.http.fileupload.IOUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -39,24 +39,6 @@ public class UploadServiceImpl implements IUploadService {
     private RedisTemplate<String, Object> redisTemplate;
 
     /**
-     * 上传文件存储在本地的根路径
-     */
-    @Value("${file.path}")
-    private String uploadFolder;
-
-    /**
-     * 资源映射路径 前缀
-     */
-    @Value("${file.prefix}")
-    public String filePrefix;
-
-    /**
-     * 资源映射路径 前缀
-     */
-    @Value("${file.bigFile}")
-    public String bigFile;
-
-    /**
      * 检查文件是否存在,如果存在则跳过该文件的上传,如果不存在,返回需要上传的分片集合
      *
      * @param chunkDTO
@@ -187,7 +169,7 @@ public class UploadServiceImpl implements IUploadService {
             urlPrefix = urlPrefix.replace(localIP, ip);
         }
         String url = urlPrefix + filePrefix+"/"+bigFile+"/"+ FileUtils.getFormatter() + "/" + fileName;*/
-        String url = filePrefix+"/"+bigFile+"/"+ FileUtils.getFormatter() + "/" + fileName;
+        String url = ResourcesConfig.filePrefix+"/bigFile/"+ FileUtils.getFormatter() + "/" + fileName;
         return url.replace("//","/").replace("./",".//");
     }
 
@@ -245,7 +227,7 @@ public class UploadServiceImpl implements IUploadService {
      */
     private String getFilePath(String identifier, String filename) {
         String ext = filename.substring(filename.lastIndexOf("."));
-        String filePath=uploadFolder +"/"+bigFile+"/"+ FileUtils.getFormatter();
+        String filePath= ResourcesConfig.filePath +"/bigFile/"+ FileUtils.getFormatter();
         File file = new File(filePath);
         if (!file.exists()) {
             file.mkdirs();
@@ -282,7 +264,7 @@ public class UploadServiceImpl implements IUploadService {
 
 
     private String getPrefixFileFolderPath(String identifier) {
-        String prefixFile=uploadFolder +"/"+filePrefix+"/"+bigFile +"/"+identifier.substring(0, 1);
+        String prefixFile=ResourcesConfig.filePath +"/"+ResourcesConfig.filePrefix+"/bigFile/"+identifier.substring(0, 1);
         return prefixFile.replace("//","/");
     }
 
@@ -293,7 +275,7 @@ public class UploadServiceImpl implements IUploadService {
      * @return
      */
     private String getFileFolderPath(String identifier) {
-        String fileFolderPath=uploadFolder+"/"+filePrefix+"/"+bigFile+"/"+identifier.substring(0, 1) + File.separator +
+        String fileFolderPath=ResourcesConfig.filePath +"/"+ResourcesConfig.filePrefix+"/bigFile/"+identifier.substring(0, 1) + File.separator +
                 identifier.substring(1, 2) + File.separator +
                 identifier + File.separator;
         return fileFolderPath.replace("//","/");

+ 22 - 11
zd-modules/zd-base/src/main/java/com/zd/base/files/file/config/ResourcesConfig.java

@@ -17,23 +17,34 @@ import java.io.File;
 @Configuration
 @RefreshScope
 public class ResourcesConfig implements WebMvcConfigurer {
-    /**
-     * 上传文件存储在本地的根路径
-     */
+
+    public static String filePath;
+
+    public static String filePrefix;
+
+    public static String fileDomain;
+
     @Value("${file.path}")
-    private String localFilePath;
+    public static void setFilePath(String filePath) {
+        ResourcesConfig.filePath = filePath;
+    }
 
-    /**
-     * 资源映射路径 前缀
-     */
     @Value("${file.prefix}")
-    public String localFilePrefix;
+    public static void setFilePrefix(String filePrefix) {
+        ResourcesConfig.filePrefix = filePrefix;
+    }
+
+    @Value("${file.domain}")
+    public void setFileDomain(String fileDomain) {
+        ResourcesConfig.fileDomain = fileDomain;
+    }
+
 
     @Override
     public void addResourceHandlers(ResourceHandlerRegistry registry) {
         /** 本地文件上传路径 */
-        registry.addResourceHandler(localFilePrefix + "/**")
-                .addResourceLocations("file:" + localFilePath + File.separator);
+        registry.addResourceHandler(ResourcesConfig.filePrefix + "/**")
+                .addResourceLocations("file:" + ResourcesConfig.filePath + File.separator);
     }
 
     /**
@@ -42,7 +53,7 @@ public class ResourcesConfig implements WebMvcConfigurer {
     @Override
     public void addCorsMappings(CorsRegistry registry) {
         // 设置允许跨域的路由
-        registry.addMapping(localFilePrefix + "/**")
+        registry.addMapping(ResourcesConfig.filePrefix + "/**")
                 // 设置允许跨域请求的域名
                 .allowedOrigins("*")
                 // 设置允许的方法

+ 3 - 20
zd-modules/zd-base/src/main/java/com/zd/base/files/file/service/LocalSysFileServiceImpl.java

@@ -1,8 +1,8 @@
 package com.zd.base.files.file.service;
 
 
+import com.zd.base.files.file.config.ResourcesConfig;
 import com.zd.base.files.file.utils.FileUploadUtils;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Primary;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
@@ -15,23 +15,6 @@ import org.springframework.web.multipart.MultipartFile;
 @Primary
 @Service
 public class LocalSysFileServiceImpl implements ISysFileService {
-    /**
-     * 资源映射路径 前缀
-     */
-    @Value("${file.prefix}")
-    public String localFilePrefix;
-
-    /**
-     * 域名或本机访问地址
-     */
-    @Value("${file.domain}")
-    public String domain;
-
-    /**
-     * 上传文件存储在本地的根路径
-     */
-    @Value("${file.path}")
-    private String localFilePath;
 
     /**
      * 本地文件上传接口
@@ -42,7 +25,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
      */
     @Override
     public String uploadFile(MultipartFile file) throws Exception {
-        String name = FileUploadUtils.upload(localFilePath, file);
+        String name = FileUploadUtils.upload(ResourcesConfig.filePath, file);
         //TODO 去掉拼接前缀
 //        String urlPrefix = domain;
 //        String localIP = "127.0.0.1";
@@ -50,7 +33,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
 //            String ip = InetAddress.getLocalHost().getHostAddress();;
 //            urlPrefix = urlPrefix.replace(localIP, ip);
 //        }
-        String url =localFilePrefix + name;
+        String url =ResourcesConfig.filePrefix + name;
         return url;
     }
 }

+ 2 - 13
zd-modules/zd-base/src/main/java/com/zd/base/files/ueditor/ActionEnter.java

@@ -13,28 +13,17 @@ import java.util.Map;
 
 public class ActionEnter {
     private HttpServletRequest request;
-    private String rootPath;
-    private String contextPath;
     private String actionType;
-    private String localFilePath;
     private String localFilePrefix;
     private String domain;
     private ConfigManager configManager;
 
-    public ActionEnter(HttpServletRequest request, String rootPath,String localFilePath,String localFilePrefix,String domain) {
-        this.request = null;
-        this.rootPath = null;
-        this.contextPath = null;
-        this.actionType = null;
-        this.configManager = null;
-        this.localFilePath=localFilePath;
+    public ActionEnter(HttpServletRequest request, String localFilePath,String localFilePrefix,String domain) {
         this.localFilePrefix=localFilePrefix;
         this.domain=domain;
         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(),localFilePath);
+        this.configManager = ConfigManager.getInstance(localFilePath);
     }
 
     public String exec() {

+ 13 - 31
zd-modules/zd-base/src/main/java/com/zd/base/files/ueditor/ConfigManager.java

@@ -2,39 +2,26 @@ package com.zd.base.files.ueditor;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+
 import java.io.*;
 import java.util.HashMap;
 import java.util.Map;
 
 public class ConfigManager {
     private String rootPath;
-    private String originalPath;
-    private String contextPath;
-    private String realPath;
-    private static String configFileName = "config.json";
-    private String parentPath;
+    private String localPath;
     private JSONObject jsonConfig;
-    private static String SCRAWL_FILE_NAME = "scrawl";
-    private static String REMOTE_FILE_NAME = "remote";
 
-    private ConfigManager(String rootPath, String contextPath, String uri,String realPath) throws FileNotFoundException, IOException {
-        this.parentPath = null;
-        this.jsonConfig = null;
-        rootPath = rootPath.replace("\\", "/");
-        this.rootPath = rootPath;
-        this.realPath = realPath;
-        this.contextPath = contextPath;
-        if (contextPath.length() > 0) {
-            this.originalPath = this.rootPath + uri.substring(contextPath.length());
-        } else {
-            this.originalPath = this.rootPath + uri;
-        }
+    private ConfigManager(String localPath) throws IOException {
+        this.rootPath = this.getClass().getClassLoader().getResource("ueditor").getPath();
+
+        this.localPath = localPath;
         this.initEnv();
     }
 
-    public static ConfigManager getInstance(String rootPath, String contextPath, String uri,String realPath) {
+    public static ConfigManager getInstance(String realPath) {
         try {
-            return new ConfigManager(rootPath, contextPath, uri,realPath);
+            return new ConfigManager(realPath);
         } catch (Exception e) {
             return null;
         }
@@ -49,7 +36,7 @@ public class ConfigManager {
     }
 
     public Map<String, Object> getConfig(int type) {
-        Map<String, Object> conf = new HashMap<String, Object>();
+        Map<String, Object> conf = new HashMap<>();
         String savePath = null;
         switch (type) {
             case 4: {
@@ -106,16 +93,11 @@ public class ConfigManager {
             }
         }
         conf.put("savePath", savePath);
-        conf.put("rootPath", this.realPath);
+        conf.put("rootPath", this.localPath);
         return conf;
     }
 
-    private void initEnv() throws FileNotFoundException, IOException {
-        File file = new File(this.originalPath);
-        if (!file.isAbsolute()) {
-            file = new File(file.getAbsolutePath());
-        }
-        this.parentPath = file.getParent();
+    private void initEnv() throws IOException {
         String configContent = this.readFile(this.getConfigPath());
         try {
             JSONObject jsonConfig = JSONObject.parseObject(configContent);
@@ -126,7 +108,7 @@ public class ConfigManager {
     }
 
     private String getConfigPath() {
-        return String.valueOf(this.parentPath) + File.separator + "config.json";
+        return this.rootPath + File.separator + "config.json";
     }
 
     private String[] getArray(String key) {
@@ -143,7 +125,7 @@ public class ConfigManager {
         try {
             InputStreamReader reader = new InputStreamReader(new FileInputStream(path), "UTF-8");
             BufferedReader bfReader = new BufferedReader(reader);
-            String tmpContent = null;
+            String tmpContent ;
             while ((tmpContent = bfReader.readLine()) != null) {
                 builder.append(tmpContent);
             }

+ 2 - 22
zd-modules/zd-base/src/main/java/com/zd/base/files/ueditor/contorller/UeditorController.java

@@ -1,8 +1,8 @@
 package com.zd.base.files.ueditor.contorller;
 
 import com.alibaba.fastjson.JSONException;
+import com.zd.base.files.file.config.ResourcesConfig;
 import com.zd.base.files.ueditor.ActionEnter;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 
@@ -19,32 +19,12 @@ import java.io.PrintWriter;
 @Controller
 public class UeditorController {
 
-    @Value("${file.config}")
-    private String rootConfig;
-
-    /**
-     * 上传文件存储在本地的根路径
-     */
-    @Value("${file.path}")
-    private String localFilePath;
-
-    /**
-     * 资源映射路径 前缀
-     */
-    @Value("${file.prefix}")
-    public String localFilePrefix;
-
-
-    @Value("${file.domain}")
-    public String domain;
-
-
     @RequestMapping("exec")
     public void getConfigInfo(HttpServletRequest request, HttpServletResponse response) {
         try {
             request.setCharacterEncoding("utf-8");
             response.setContentType("application/json");
-            String exec = new ActionEnter(request, rootConfig,localFilePath,localFilePrefix,domain).exec();
+            String exec = new ActionEnter(request, ResourcesConfig.filePath , ResourcesConfig.filePrefix, ResourcesConfig.fileDomain).exec();
             PrintWriter writer = response.getWriter();
             writer.write(exec);
             writer.flush();

+ 0 - 60
zd-modules/zd-base/src/main/java/com/zd/base/files/ueditor/upload/UploadUtils.java

@@ -1,60 +0,0 @@
-package com.zd.base.files.ueditor.upload;
-
-import com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.util.internal.StringUtil;
-import org.apache.commons.io.FileUtils;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-
-@Component
-public class UploadUtils {
-
-    private static String filePathStatic;
-
-    @Value("${file.path}")
-    public void setFilePathStatic(String filePath) {
-        filePathStatic = filePath;
-    }
-
-    /**
-     * 上传方法
-     *
-     * @param in
-     * @param typePath
-     * @param picName
-     * @return
-     * @throws IOException
-     */
-    public boolean uploadFile(InputStream in, String typePath, String picName) throws IOException {
-        String appendPath = typePath;
-        File filepath = new File(filePathStatic + File.separator + appendPath);
-        if (!filepath.exists()) { //如果不存在则创建
-            filepath.mkdirs();
-        }
-        filepath = new File(filePathStatic + File.separator + appendPath + File.separator + picName);
-        FileUtils.touch(filepath);
-        FileUtils.copyInputStreamToFile(in, filepath);
-        return true;
-    }
-
-
-    /**
-     * 添加上传文件目录
-     *
-     * @param typePath
-     * @return
-     */
-    private String getFilesPath(String typePath) {
-        StringBuilder path = new StringBuilder("/uploadFile");
-        if (StringUtil.isNullOrEmpty(typePath)) {
-            path.append("/uploads");
-        } else {
-            path.append("/" + typePath);
-        }
-        path = path.append("/");
-        return path.toString();
-    }
-}

+ 0 - 68
zd-modules/zd-base/src/main/resources/config.json

@@ -1,68 +0,0 @@
-{
-    "imageActionName": "uploadimage",
-    "imageFieldName": "upfile",
-    "imageMaxSize": 2048000,
-    "imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"],
-    "imageCompressEnable": true,
-    "imageCompressBorder": 1600,
-    "imageInsertAlign": "none",
-    "imageUrlPrefix": "",
-    "localSavePathPrefix":"statics/upload/images/inform",
-    "imagePathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
-    "scrawlActionName": "uploadscrawl",
-    "scrawlFieldName": "upfile",
-    "scrawlPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
-    "scrawlMaxSize": 2048000,
-    "scrawlUrlPrefix": "",
-    "scrawlInsertAlign": "none",
-    "snapscreenActionName": "uploadimage",
-    "snapscreenPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
-    "snapscreenUrlPrefix": "",
-    "snapscreenInsertAlign": "none",
-    "catcherLocalDomain": ["127.0.0.1", "localhost", "img.baidu.com"],
-    "catcherActionName": "catchimage",
-    "catcherFieldName": "source",
-    "catcherPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
-    "catcherUrlPrefix": "",
-    "catcherMaxSize": 2048000,
-    "catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"],
-    "catchRemoteImageEnable": false,
-    "videoActionName": "uploadvideo",
-    "videoFieldName": "upfile",
-    "videoPathFormat": "/ueditor/jsp/upload/video/{yyyy}{mm}{dd}/{time}{rand:6}",
-    "videoUrlPrefix": "",
-    "videoMaxSize": 10240000000,
-    "videoAllowFiles": [
-        ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
-        ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"],
-    "fileActionName": "uploadfile",
-    "fileFieldName": "upfile",
-    "filePathFormat": "/ueditor/jsp/upload/file/{yyyy}{mm}{dd}/{time}{rand:6}",
-    "fileUrlPrefix": "",
-    "fileMaxSize": 5120000000,
-    "fileAllowFiles": [
-        ".png", ".jpg", ".jpeg", ".gif", ".bmp",
-        ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
-        ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
-        ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
-        ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"
-    ],
-    "imageManagerActionName": "listimage",
-    "imageManagerListPath": "/ueditor/jsp/upload/image/",
-    "imageManagerListSize": 20,
-    "imageManagerUrlPrefix": "",
-    "imageManagerInsertAlign": "none",
-    "imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"],
-    "fileManagerActionName": "listfile",
-    "fileManagerListPath": "/ueditor/jsp/upload/file/",
-    "fileManagerUrlPrefix": "",
-    "fileManagerListSize": 20,
-    "fileManagerAllowFiles": [
-        ".png", ".jpg", ".jpeg", ".gif", ".bmp",
-        ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg",
-        ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid",
-        ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso",
-        ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml"
-    ]
-
-}

+ 246 - 0
zd-modules/zd-base/src/main/resources/ueditor/config.json

@@ -0,0 +1,246 @@
+/* 前后端通信相关的配置,注释只允许使用多行方式 */
+{
+  /* 上传图片配置项 */
+  "imageActionName": "uploadimage",
+  /* 执行上传图片的action名称 */
+  "imageFieldName": "upfile",
+  /* 提交的图片表单名称 */
+  "imageMaxSize": 2048000,
+  /* 上传大小限制,单位B */
+  "imageAllowFiles": [
+    ".png",
+    ".jpg",
+    ".jpeg",
+    ".gif",
+    ".bmp"
+  ],
+  /* 上传图片格式显示 */
+  "imageCompressEnable": true,
+  /* 是否压缩图片,默认是true */
+  "imageCompressBorder": 1600,
+  /* 图片压缩最长边限制 */
+  "imageInsertAlign": "none",
+  /* 插入的图片浮动方式 */
+  "imageUrlPrefix": "",
+  /* 图片访问路径前缀 */
+  "imagePathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
+  /* 上传保存路径,可以自定义保存路径和文件名格式 */
+  /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */
+  /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */
+  /* {time} 会替换成时间戳 */
+  /* {yyyy} 会替换成四位年份 */
+  /* {yy} 会替换成两位年份 */
+  /* {mm} 会替换成两位月份 */
+  /* {dd} 会替换成两位日期 */
+  /* {hh} 会替换成两位小时 */
+  /* {ii} 会替换成两位分钟 */
+  /* {ss} 会替换成两位秒 */
+  /* 非法字符 \ : * ? " < > | */
+  /* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */
+
+  /* 涂鸦图片上传配置项 */
+  "scrawlActionName": "uploadscrawl",
+  /* 执行上传涂鸦的action名称 */
+  "scrawlFieldName": "upfile",
+  /* 提交的图片表单名称 */
+  "scrawlPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
+  /* 上传保存路径,可以自定义保存路径和文件名格式 */
+  "scrawlMaxSize": 2048000,
+  /* 上传大小限制,单位B */
+  "scrawlUrlPrefix": "",
+  /* 图片访问路径前缀 */
+  "scrawlInsertAlign": "none",
+  /* 截图工具上传 */
+  "snapscreenActionName": "uploadimage",
+  /* 执行上传截图的action名称 */
+  "snapscreenPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
+  /* 上传保存路径,可以自定义保存路径和文件名格式 */
+  "snapscreenUrlPrefix": "",
+  /* 图片访问路径前缀 */
+  "snapscreenInsertAlign": "none",
+  /* 插入的图片浮动方式 */
+
+  /* 抓取远程图片配置 */
+  "catcherLocalDomain": [
+    "127.0.0.1",
+    "localhost",
+    "img.baidu.com"
+  ],
+  "catcherActionName": "catchimage",
+  /* 执行抓取远程图片的action名称 */
+  "catcherFieldName": "source",
+  /* 提交的图片列表表单名称 */
+  "catcherPathFormat": "/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
+  /* 上传保存路径,可以自定义保存路径和文件名格式 */
+  "catcherUrlPrefix": "",
+  /* 图片访问路径前缀 */
+  "catcherMaxSize": 2048000,
+  /* 上传大小限制,单位B */
+  "catcherAllowFiles": [
+    ".png",
+    ".jpg",
+    ".jpeg",
+    ".gif",
+    ".bmp"
+  ],
+  /* 抓取图片格式显示 */
+
+  /* 上传视频配置 */
+  "videoActionName": "uploadvideo",
+  /* 执行上传视频的action名称 */
+  "videoFieldName": "upfile",
+  /* 提交的视频表单名称 */
+  "videoPathFormat": "/ueditor/jsp/upload/video/{yyyy}{mm}{dd}/{time}{rand:6}",
+  /* 上传保存路径,可以自定义保存路径和文件名格式 */
+  "videoUrlPrefix": "",
+  /* 视频访问路径前缀 */
+  "videoMaxSize": 102400000,
+  /* 上传大小限制,单位B,默认100MB */
+  "videoAllowFiles": [
+    ".flv",
+    ".swf",
+    ".mkv",
+    ".avi",
+    ".rm",
+    ".rmvb",
+    ".mpeg",
+    ".mpg",
+    ".ogg",
+    ".ogv",
+    ".mov",
+    ".wmv",
+    ".mp4",
+    ".webm",
+    ".mp3",
+    ".wav",
+    ".mid"
+  ],
+  /* 上传视频格式显示 */
+
+  /* 上传文件配置 */
+  "fileActionName": "uploadfile",
+  /* controller里,执行上传视频的action名称 */
+  "fileFieldName": "upfile",
+  /* 提交的文件表单名称 */
+  "filePathFormat": "/ueditor/jsp/upload/file/{yyyy}{mm}{dd}/{time}{rand:6}",
+  /* 上传保存路径,可以自定义保存路径和文件名格式 */
+  "fileUrlPrefix": "",
+  /* 文件访问路径前缀 */
+  "fileMaxSize": 51200000,
+  /* 上传大小限制,单位B,默认50MB */
+  "fileAllowFiles": [
+    ".png",
+    ".jpg",
+    ".jpeg",
+    ".gif",
+    ".bmp",
+    ".flv",
+    ".swf",
+    ".mkv",
+    ".avi",
+    ".rm",
+    ".rmvb",
+    ".mpeg",
+    ".mpg",
+    ".ogg",
+    ".ogv",
+    ".mov",
+    ".wmv",
+    ".mp4",
+    ".webm",
+    ".mp3",
+    ".wav",
+    ".mid",
+    ".rar",
+    ".zip",
+    ".tar",
+    ".gz",
+    ".7z",
+    ".bz2",
+    ".cab",
+    ".iso",
+    ".doc",
+    ".docx",
+    ".xls",
+    ".xlsx",
+    ".ppt",
+    ".pptx",
+    ".pdf",
+    ".txt",
+    ".md",
+    ".xml"
+  ],
+  /* 上传文件格式显示 */
+
+  /* 列出指定目录下的图片 */
+  "imageManagerActionName": "listimage",
+  /* 执行图片管理的action名称 */
+  "imageManagerListPath": "/ueditor/jsp/upload/image/",
+  /* 指定要列出图片的目录 */
+  "imageManagerListSize": 20,
+  /* 每次列出文件数量 */
+  "imageManagerUrlPrefix": "",
+  /* 图片访问路径前缀 */
+  "imageManagerInsertAlign": "none",
+  /* 插入的图片浮动方式 */
+  "imageManagerAllowFiles": [
+    ".png",
+    ".jpg",
+    ".jpeg",
+    ".gif",
+    ".bmp"
+  ],
+  /* 列出的文件类型 */
+
+  /* 列出指定目录下的文件 */
+  "fileManagerActionName": "listfile",
+  /* 执行文件管理的action名称 */
+  "fileManagerListPath": "/ueditor/jsp/upload/file/",
+  /* 指定要列出文件的目录 */
+  "fileManagerUrlPrefix": "",
+  /* 文件访问路径前缀 */
+  "fileManagerListSize": 20,
+  /* 每次列出文件数量 */
+  "fileManagerAllowFiles": [
+    ".png",
+    ".jpg",
+    ".jpeg",
+    ".gif",
+    ".bmp",
+    ".flv",
+    ".swf",
+    ".mkv",
+    ".avi",
+    ".rm",
+    ".rmvb",
+    ".mpeg",
+    ".mpg",
+    ".ogg",
+    ".ogv",
+    ".mov",
+    ".wmv",
+    ".mp4",
+    ".webm",
+    ".mp3",
+    ".wav",
+    ".mid",
+    ".rar",
+    ".zip",
+    ".tar",
+    ".gz",
+    ".7z",
+    ".bz2",
+    ".cab",
+    ".iso",
+    ".doc",
+    ".docx",
+    ".xls",
+    ".xlsx",
+    ".ppt",
+    ".pptx",
+    ".pdf",
+    ".txt",
+    ".md",
+    ".xml"
+  ]
+}