mingsoft před 6 měsíci
rodič
revize
147f6996e3

+ 82 - 104
pom.xml

@@ -1,67 +1,45 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
-        <version>2.7.18</version>
+        <version>3.4.2</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
     <groupId>net.mingsoft</groupId>
     <artifactId>ms-mcms</artifactId>
-    <version>5.4.5</version>
+    <version>6.0.0</version>
     <name>${project.groupId}:${project.artifactId}</name>
-    <!-- 打包war包,注意不启用(resources》resource》excludes的配置并注释掉maven-assembly-plugin 插件配置 -->
-    <!--<packaging>war</packaging>-->
+    <!-- 打包war包 -->
     <properties>
-        <java.version>1.8</java.version>
+        <java.version>17</java.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <log4j.version>2.20.0</log4j.version>
+        <log4j.version>2.23.0</log4j.version>
     </properties>
-    <repositories>
-        <repository>
-            <id>central-repos</id>
-            <name>Central Repository 2</name>
-            <url>https://repo.maven.apache.org/maven2/</url>
-        </repository>
-        <!--阿里云仓库,注意:如果使用阿里云仓库遇到启动缺少jar包的时候,必须使用国外中央库拉取-->
-        <!--
-        <repository>
-            <id>alimaven</id>
-            <name>aliyun maven</name>
-            <url>https://maven.aliyun.com/nexus/content/groups/public/</url>
-            <releases>
-                <enabled>true</enabled>
-            </releases>
-            <snapshots>
-                <enabled>true</enabled>
-            </snapshots>
-        </repository>
-        -->
-    </repositories>
+    <packaging>jar</packaging>
+
     <dependencies>
         <dependency>
             <groupId>net.mingsoft</groupId>
             <artifactId>ms-base</artifactId>
-            <version>2.2.8</version>
+            <version>3.0.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>net.mingsoft</groupId>
             <artifactId>ms-basic</artifactId>
-            <version>2.2.8</version>
+            <version>3.0.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>net.mingsoft</groupId>
             <artifactId>ms-mdiy</artifactId>
-            <version>2.2.8</version>
+            <version>3.0.0-SNAPSHOT</version>
         </dependency>
-
-        <!--store入口依赖(源码不开发),如果不需要MStore可以直接去掉依赖-->
         <dependency>
             <groupId>net.mingsoft</groupId>
             <artifactId>store-client</artifactId>
-            <version>2.2.8</version>
+            <version>3.0.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>com.github.oshi</groupId>
@@ -135,79 +113,79 @@
                     <!-- 如果生产需要实时修改WEB-INF/下的页面可,启用这行并手动将项目中的WEB-INF目录复制到运行环境 -->
                     <!-- <exclude>WEB-INF/</exclude> -->
                 </excludes>
-         </resource>
-         <resource>
-             <directory>src/main/resources</directory>
-         </resource>
-         <resource>
-             <directory>src/main/java</directory>
-             <excludes>
-                 <exclude>**/*.java</exclude>
-             </excludes>
-         </resource>
-     </resources>
-     <plugins>
-         <plugin>
-             <groupId>org.springframework.boot</groupId>
-             <artifactId>spring-boot-maven-plugin</artifactId>
-             <configuration>
-                 <mainClass>net.mingsoft.MSApplication</mainClass>
-                 <executable>true</executable>
-                 <includeSystemScope>true</includeSystemScope>
-                 <fork>true</fork>
-             </configuration>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <mainClass>net.mingsoft.MSApplication</mainClass>
+                    <executable>true</executable>
+                    <includeSystemScope>true</includeSystemScope>
+                    <fork>true</fork>
+                </configuration>
 
-         </plugin>
+            </plugin>
 
-         <plugin>
-             <groupId>org.apache.maven.plugins</groupId>
-             <artifactId>maven-compiler-plugin</artifactId>
-             <version>3.1</version>
-             <configuration>
-                 <source>${java.version}</source>
-                 <target>${java.version}</target>
-                 <encoding>${project.build.sourceEncoding}</encoding>
-                 <showDeprecation>true</showDeprecation>
-                 <showWarnings>true</showWarnings>
-                 <compilerArguments>
-                     <verbose/>
-                     <bootclasspath>${java.home}/lib/rt.jar${path.separator}${java.home}/lib/jce.jar</bootclasspath>
-                 </compilerArguments>
-             </configuration>
-             <dependencies>
-                 <dependency>
-                     <groupId>org.codehaus.plexus</groupId>
-                     <artifactId>plexus-compiler-eclipse</artifactId>
-                     <version>2.1</version>
-                 </dependency>
-             </dependencies>
-         </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.1</version>
+                <configuration>
+                    <source>${java.version}</source>
+                    <target>${java.version}</target>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                    <showDeprecation>true</showDeprecation>
+                    <showWarnings>true</showWarnings>
+                    <compilerArguments>
+                        <verbose/>
+                        <bootclasspath>${java.home}/lib/rt.jar${path.separator}${java.home}/lib/jce.jar</bootclasspath>
+                    </compilerArguments>
+                </configuration>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.codehaus.plexus</groupId>
+                        <artifactId>plexus-compiler-eclipse</artifactId>
+                        <version>2.1</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
 
-         <!-- 结合(resources》resource》excludes的配置使用 -->
-         <!-- 打包出的结构 http://doc.mingsoft.net/server/huan-jing-pei-zhi/jarbu-shu.html#%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84-->
-         <!-- 打包war包时,注释掉此插件-->
-         <plugin>
-             <artifactId>maven-assembly-plugin</artifactId>
-             <version>3.1.1</version>
-             <executions>
-                 <execution>
-                     <id>build-package</id>
-                     <phase>package</phase>
-                     <goals>
-                         <goal>single</goal>
-                     </goals>
-                     <configuration>
-                         <finalName>${project.artifactId}</finalName>
-                         <descriptors>
-                             <descriptor>assembly.xml</descriptor>
-                         </descriptors>
-                     </configuration>
-                 </execution>
-             </executions>
-         </plugin>
+            <!-- 结合(resources》resource》excludes的配置使用 -->
+            <!-- 打包出的结构 http://doc.mingsoft.net/server/huan-jing-pei-zhi/jarbu-shu.html#%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84-->
+            <!-- 打包war包时,注释掉此插件-->
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>3.1.1</version>
+                <executions>
+                    <execution>
+                        <id>build-package</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <finalName>${project.artifactId}</finalName>
+                            <descriptors>
+                                <descriptor>assembly.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
 
 
-     </plugins>
-     <defaultGoal>compile</defaultGoal>
- </build>
+        </plugins>
+        <defaultGoal>compile</defaultGoal>
+    </build>
 </project>

+ 96 - 3
src/main/java/net/mingsoft/cms/action/BaseAction.java

@@ -22,6 +22,25 @@
 
 package net.mingsoft.cms.action;
 
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.file.FileNameUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.json.JSONUtil;
+import io.github.xcodeding.UeditorActionEnter;
+import jakarta.servlet.http.HttpServletRequest;
+import net.mingsoft.base.constant.Const;
+import net.mingsoft.base.exception.BusinessException;
+import net.mingsoft.base.util.BundleUtil;
+import net.mingsoft.basic.entity.AppEntity;
+import net.mingsoft.basic.util.BasicUtil;
+import net.mingsoft.config.MSProperties;
+import net.mingsoft.mdiy.util.ConfigUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.MissingResourceException;
 
 /**
@@ -29,16 +48,90 @@ import java.util.MissingResourceException;
  * @Date: 2019/8/9 20:47
  */
 public class BaseAction extends net.mingsoft.basic.action.BaseAction{
-    @Override
+    /**
+     * 读取国际化资源文件(没有占位符号的),优先模块对应的资源文件,如果模块资源文件找不到就会优先基础层
+     * @param key 国际化文件key
+     * @return 国际化字符串
+     */
     protected String getResString(String key) {
-        
+        return this.getResString(key,"");
+    }
+
+    /**
+     * 读取国际化资源文件,优先模块对应的资源文件,如果模块资源文件找不到就会优先基础层
+     * @param key 国际化文件key
+     * @param params 拼接值
+     * @return 国际化字符串
+     */
+    protected String getResString(String key,String... params) {
+        // TODO Auto-generated method stub
         String str = "";
         try {
             str = super.getResString(key);
+            //替换占位
+            for (int i = 0; i < params.length; i++) {
+                str = str.replace("{" + i + "}", params[i]);
+            }
         } catch (MissingResourceException e) {
-            str = getLocaleString(key,net.mingsoft.cms.constant.Const.RESOURCES);
+            str = BundleUtil.getString(net.mingsoft.cms.constant.Const.RESOURCES, key,params);
         }
 
         return str;
     }
+
+
+    /**
+     * 抽取百度编辑器执行公共部分
+     * @param request 请求
+     * @param upfile 文件
+     * @param execFileConfigMap 上传大小配置Map 应包含 imageMaxSize、videoMaxSize、fileMaxSize
+     * @param version 编辑器版本
+     * @return 执行结果响应
+     */
+    public String exec(HttpServletRequest request, MultipartFile upfile, Map execFileConfigMap, String version){
+        String uploadFolderPath = MSProperties.upload.path;
+
+        String configRootPath = ConfigUtil.getString("文件上传配置", "uploadPath", "");
+        uploadFolderPath = StringUtils.isBlank(configRootPath) ? uploadFolderPath : configRootPath;
+        String rootPath = BasicUtil.getRealPath(uploadFolderPath);
+
+        Map execConfigMap = new HashMap();
+        execConfigMap.putAll(execFileConfigMap);
+
+        AppEntity app = BasicUtil.getApp();
+
+        String datePath = DateUtil.format(new Date(), "yyyyMMdd");
+
+        // /appId/editor/yyyyMMdd/{time}
+        String filePathFormat = "/".concat(app.getAppId()).concat("/editor/").concat(datePath).concat("/").concat("{time}");
+
+        execConfigMap.put("imagePathFormat", filePathFormat);
+        execConfigMap.put("filePathFormat", filePathFormat);
+        execConfigMap.put("videoPathFormat", filePathFormat);
+        execConfigMap.put("catcherPathFormat", filePathFormat);
+        execConfigMap.put("scrawlPathFormat", filePathFormat);
+        execConfigMap.put("snapscreenPathFormat", filePathFormat);
+
+        String execConfig = JSONUtil.toJsonStr(execConfigMap);
+
+        // 文件主名称不允许为空
+        if (upfile != null){
+            String upFileMainName = FileNameUtil.mainName(upfile.getOriginalFilename());
+            if (StringUtils.isBlank(upFileMainName)){
+                throw new BusinessException(getResString("err.error",getResString("file.name")));
+            }
+        }
+
+        //过滤非法上传路径
+        if (execConfig != null && (execConfig.contains("../") || execConfig.contains("..\\"))) {
+            throw new BusinessException(BundleUtil.getString(Const.RESOURCES,"err.error",BundleUtil.getString(net.mingsoft.basic.constant.Const.RESOURCES,"file.path")));
+        }
+        UeditorActionEnter actionEnter = new UeditorActionEnter(upfile,request, rootPath, execConfig, BasicUtil.getRealPath(""), BasicUtil.getRealPath(StrUtil.format("static/plugins/ueditor/{}/config.json",version)));
+        String result = actionEnter.exec();
+        Map jsonMap = JSONUtil.toBean(result,Map.class);
+        jsonMap.put("url","/".concat(uploadFolderPath).concat(jsonMap.get("url")+""));
+        return JSONUtil.toJsonStr(jsonMap);
+
+
+    }
 }

+ 84 - 83
src/main/java/net/mingsoft/cms/action/CategoryAction.java

@@ -26,10 +26,13 @@ import cn.hutool.core.io.file.FileNameUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Hidden;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.tags.Tag;
 import net.mingsoft.base.entity.ResultData;
 import net.mingsoft.basic.annotation.LogAnn;
 import net.mingsoft.basic.bean.EUListBean;
@@ -47,7 +50,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
-import springfox.documentation.annotations.ApiIgnore;
 
 import java.util.List;
 
@@ -57,7 +59,7 @@ import java.util.List;
  * 创建日期:2019-11-28 15:12:32<br/>
  * 历史修订:<br/>
  */
-@Api(tags = {"后端-内容模块接口"})
+@Tag(name = "后端-内容模块接口")
 @Controller("cmsCategoryAction")
 @RequestMapping("/${ms.manager.path}/cms/category")
 public class CategoryAction extends BaseAction {
@@ -73,7 +75,7 @@ public class CategoryAction extends BaseAction {
      * 返回主界面index
      * @return
      */
-    @ApiIgnore
+    @Hidden
     @GetMapping("/index")
     @RequiresPermissions("cms:category:view")
     public String index() {
@@ -85,14 +87,14 @@ public class CategoryAction extends BaseAction {
      * @param category 栏目实体
      * @return
      */
-    @ApiOperation(value = "查询分类列表接口")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "categoryTitle", value = "栏目管理名称", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryParentId", value = "父类型编号", required = false, paramType = "query"),
+    @Operation(summary =  "查询分类列表接口")
+    @Parameters({
+            @Parameter(name = "categoryTitle", description = "栏目管理名称", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryParentId", description = "父类型编号", required =  false, in = ParameterIn.QUERY),
     })
     @RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST})
     @ResponseBody
-    public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category) {
+    public ResultData list(@ModelAttribute @Parameter(hidden = true) CategoryEntity category) {
         // TODO: 2024/12/2 为了拓展栏目使用方法,增加isChild字段处理
         // 这里根据外部传值,如果没有则默认查询cms下栏目
         if (StrUtil.isBlank(category.getIsChild())) {
@@ -107,7 +109,7 @@ public class CategoryAction extends BaseAction {
      * @param category 栏目
      * @return
      */
-    @ApiIgnore
+    @Hidden
     @GetMapping("/form")
     public String form(@ModelAttribute CategoryEntity category, ModelMap model) {
         model.addAttribute("appId", BasicUtil.getApp().getAppId());
@@ -118,12 +120,12 @@ public class CategoryAction extends BaseAction {
      * 获取分类
      * @param category 分类实体
      */
-    @ApiOperation(value = "获取分类详情接口")
-    @ApiImplicitParam(name = "id", value = "编号", required = true, paramType = "query")
+    @Operation(summary =  "获取分类详情接口")
+    @Parameter(name = "id", description = "编号", required =  true, in = ParameterIn.QUERY)
     @GetMapping("/get")
     @RequiresPermissions("cms:category:view")
     @ResponseBody
-    public ResultData get(@ModelAttribute @ApiIgnore CategoryEntity category) {
+    public ResultData get(@ModelAttribute @Parameter(hidden = true) CategoryEntity category) {
         if (StringUtils.isBlank(category.getId())) {
             return ResultData.build().error(getResString("err.empty",this.getResString("id")));
         }
@@ -136,38 +138,38 @@ public class CategoryAction extends BaseAction {
      * 保存分类
      * @param category 分类实体
      */
-    @ApiOperation(value = "保存分类列表接口")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "categoryTitle", value = "栏目管理名称", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "categoryType", value = "栏目类型,1:列表,2:单篇,3:链接", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "categoryDisplay", value = "栏目是否显示,enable:显示 disable:不显示", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "categoryIsSearch", value = "栏目是否可搜索,enable:可搜索 disable:不可搜索", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "categoryId", value = "所属栏目", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categorySort", value = "自定义顺序", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryListUrl", value = "列表模板", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryUrl", value = "内容模板", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryKeyword", value = "栏目管理关键字", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryDescrip", value = "栏目管理描述", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryImg", value = "缩略图", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryIco", value = "栏目小图", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryDiyUrl", value = "自定义链接", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "mdiyModelId", value = "栏目管理的内容模型id", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "dictId", value = "字典对应编号", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryFlag", value = "栏目属性", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryPath", value = "栏目路径", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryParentIds", value = "父类型编号", required = false, paramType = "query"),
+    @Operation(summary =  "保存分类列表接口")
+    @Parameters({
+            @Parameter(name = "categoryTitle", description = "栏目管理名称", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryType", description = "栏目类型,1:列表,2:单篇,3:链接", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryDisplay", description = "栏目是否显示,enable:显示 disable:不显示", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryIsSearch", description = "栏目是否可搜索,enable:可搜索 disable:不可搜索", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryId", description = "所属栏目", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categorySort", description = "自定义顺序", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryListUrl", description = "列表模板", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryUrl", description = "内容模板", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryKeyword", description = "栏目管理关键字", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryDescrip", description = "栏目管理描述", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryImg", description = "缩略图", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryIco", description = "栏目小图", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryDiyUrl", description = "自定义链接", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "mdiyModelId", description = "栏目管理的内容模型id", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "dictId", description = "字典对应编号", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryFlag", description = "栏目属性", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryPath", description = "栏目路径", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryParentIds", description = "父类型编号", required =  false, in = ParameterIn.QUERY),
     })
     @PostMapping("/save")
     @ResponseBody
     @LogAnn(title = "保存分类", businessType = BusinessTypeEnum.INSERT)
     @RequiresPermissions("cms:category:save")
-    public ResultData save(@ModelAttribute @ApiIgnore CategoryEntity category) {
+    public ResultData save(@ModelAttribute @Parameter(hidden = true) CategoryEntity category) {
         //验证缩略图参数值是否合法
         if (category.getCategoryImg() == null || !category.getCategoryImg().matches("^\\[.{1,}]$")) {
             category.setCategoryImg("");
         }
         //验证栏目管理名称的值是否合法
-        if (StringUtil.isBlank(category.getCategoryTitle())) {
+        if (StringUtils.isBlank(category.getCategoryTitle())) {
             return ResultData.build().error(getResString("err.empty", this.getResString("category.title")));
         }
         if (!StringUtil.checkLength(category.getCategoryTitle() + "", 1, 100)) {
@@ -247,10 +249,9 @@ public class CategoryAction extends BaseAction {
      * @param categorys
      * @return
      */
-    @ApiOperation(value = "批量删除分类列表接口")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "categorys", value = "删除的栏目集合", allowMultiple = true, dataType = "CategoryEntity", required = true)
-
+    @Operation(summary = "批量删除分类列表接口")
+    @Parameters({
+            @Parameter(name = "categorys", description = "删除的栏目集合", schema = @Schema(allOf = CategoryEntity.class ), required = true)
     })
     @PostMapping("/delete")
     @ResponseBody
@@ -267,33 +268,33 @@ public class CategoryAction extends BaseAction {
      *	更新分类列表
      * @param category 分类实体
      */
-    @ApiOperation(value = "更新分类列表接口")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "编号", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "categoryTitle", value = "栏目管理名称", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "categoryDisplay", value = "栏目是否显示,enable:显示 disable:不显示", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "categoryIsSearch", value = "栏目是否可搜索,enable:可搜索 disable:不可搜索", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "categoryType", value = "栏目类型,1:列表,2:单篇,3:链接", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "categoryId", value = "所属栏目", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categorySort", value = "自定义顺序", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryListUrl", value = "列表模板", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryUrl", value = "内容模板", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryKeyword", value = "栏目管理关键字", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryDescrip", value = "栏目管理描述", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryImg", value = "banner图", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryIco", value = "栏目小图", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryDiyUrl", value = "自定义链接", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "mdiyModelId", value = "栏目管理的内容模型id", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "dictId", value = "字典对应编号", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryFlag", value = "栏目属性", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryPath", value = "栏目路径", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryParentIds", value = "父类型编号", required = false, paramType = "query"),
+    @Operation(summary =  "更新分类列表接口")
+    @Parameters({
+            @Parameter(name = "id", description = "编号", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryTitle", description = "栏目管理名称", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryDisplay", description = "栏目是否显示,enable:显示 disable:不显示", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryIsSearch", description = "栏目是否可搜索,enable:可搜索 disable:不可搜索", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryType", description = "栏目类型,1:列表,2:单篇,3:链接", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryId", description = "所属栏目", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categorySort", description = "自定义顺序", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryListUrl", description = "列表模板", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryUrl", description = "内容模板", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryKeyword", description = "栏目管理关键字", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryDescrip", description = "栏目管理描述", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryImg", description = "banner图", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryIco", description = "栏目小图", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryDiyUrl", description = "自定义链接", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "mdiyModelId", description = "栏目管理的内容模型id", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "dictId", description = "字典对应编号", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryFlag", description = "栏目属性", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryPath", description = "栏目路径", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryParentIds", description = "父类型编号", required =  false, in = ParameterIn.QUERY),
     })
     @PostMapping("/update")
     @ResponseBody
     @LogAnn(title = "更新分类", businessType = BusinessTypeEnum.UPDATE)
     @RequiresPermissions("cms:category:update")
-    public ResultData update(@ModelAttribute @ApiIgnore CategoryEntity category) {
+    public ResultData update(@ModelAttribute @Parameter(hidden = true) CategoryEntity category) {
         //验证缩略图参数值是否合法
         if (category.getCategoryImg() == null || !category.getCategoryImg().matches("^\\[.{1,}]$")) {
             category.setCategoryImg("");
@@ -302,7 +303,7 @@ public class CategoryAction extends BaseAction {
             return ResultData.build().error(getResString("err.empty", this.getResString("category.id")));
         }
         //验证栏目管理名称的值是否合法
-        if (StringUtil.isBlank(category.getCategoryTitle())) {
+        if (StringUtils.isBlank(category.getCategoryTitle())) {
             return ResultData.build().error(getResString("err.empty", this.getResString("category.title")));
         }
         if (!StringUtil.checkLength(category.getCategoryTitle() + "", 1, 100)) {
@@ -371,7 +372,7 @@ public class CategoryAction extends BaseAction {
         }
         CategoryEntity categoryEntity = new CategoryEntity();
         categoryEntity.setCategoryPinyin(pingYin);
-        CategoryEntity categoryBizEntity = categoryBiz.getEntity(categoryEntity);
+        CategoryEntity categoryBizEntity = categoryBiz.getOne(new LambdaQueryWrapper<>(categoryEntity));
         category.setCategoryPinyin(pingYin);
         //如果存在此拼音栏目则拼接上id
         if (categoryBizEntity != null && !categoryBizEntity.getId().equals(category.getId())) {
@@ -402,14 +403,14 @@ public class CategoryAction extends BaseAction {
      * @param category 栏目
      * @return
      */
-    @ApiOperation(value = "验证拼音")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "编号", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "categoryPinyin", value = "栏目管拼音", required = true, paramType = "query"),
+    @Operation(summary =  "验证拼音")
+    @Parameters({
+            @Parameter(name = "id", description = "编号", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryPinyin", description = "栏目管拼音", required =  true, in = ParameterIn.QUERY),
     })
     @GetMapping("/verifyPingYin")
     @ResponseBody
-    public ResultData verifyPingYin(@ModelAttribute @ApiIgnore CategoryEntity category) {
+    public ResultData verifyPingYin(@ModelAttribute @Parameter(hidden = true) CategoryEntity category) {
         //验证id是否合法
         if (StringUtils.isEmpty(category.getId())){
             return ResultData.build().error(getResString("err.empty", this.getResString("id")));
@@ -442,14 +443,14 @@ public class CategoryAction extends BaseAction {
      * @param category 栏目实体
      * @return
      */
-    @ApiOperation(value = "批量更新模板")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "编号", required = true, paramType = "query"),
+    @Operation(summary =  "批量更新模板")
+    @Parameters({
+            @Parameter(name = "id", description = "编号", required =  true, in = ParameterIn.QUERY),
     })
     @GetMapping("/updateTemplate")
     @ResponseBody
     @RequiresPermissions("cms:category:update")
-    public ResultData updateTemplate(@ModelAttribute @ApiIgnore CategoryEntity category) {
+    public ResultData updateTemplate(@ModelAttribute @Parameter(hidden = true) CategoryEntity category) {
         if (category == null || StringUtils.isEmpty(category.getId())) {
             return ResultData.build().error(getResString("err.error", this.getResString("id")));
         }
@@ -472,14 +473,14 @@ public class CategoryAction extends BaseAction {
      * @param category 栏目实体
      * @return
      */
-    @ApiOperation(value = "复制栏目")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "编号", required = true, paramType = "query")
+    @Operation(summary =  "复制栏目")
+    @Parameters({
+            @Parameter(name = "id", description = "编号", required =  true, in = ParameterIn.QUERY)
     })
     @GetMapping("/copyCategory")
     @ResponseBody
     @RequiresPermissions("cms:category:save")
-    public ResultData copyCategory(@ModelAttribute @ApiIgnore CategoryEntity category) {
+    public ResultData copyCategory(@ModelAttribute @Parameter(hidden = true) CategoryEntity category) {
         if (category == null || StringUtils.isEmpty(category.getId())) {
             return ResultData.build().error(getResString("err.error", this.getResString("id")));
         }
@@ -488,10 +489,10 @@ public class CategoryAction extends BaseAction {
     }
 
 
-    @ApiOperation(value = "强制转换类型接口")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "typeid", value = "编号", required =true,paramType="query"),
-            @ApiImplicitParam(name = "categoryType", value = "栏目类型,1:列表,2:单篇,3:链接", required =true,paramType="query")
+    @Operation(summary =  "强制转换类型接口")
+    @Parameters({
+            @Parameter(name = "typeid", description = "编号", required = true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryType", description = "栏目类型,1:列表,2:单篇,3:链接", required = true, in = ParameterIn.QUERY)
     })
     @GetMapping("/changeType")
     @ResponseBody

+ 68 - 66
src/main/java/net/mingsoft/cms/action/ContentAction.java

@@ -23,10 +23,13 @@
 package net.mingsoft.cms.action;
 
 import cn.hutool.core.util.StrUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Hidden;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.tags.Tag;
 import net.mingsoft.base.entity.ResultData;
 import net.mingsoft.base.util.SqlInjectionUtil;
 import net.mingsoft.basic.annotation.LogAnn;
@@ -47,9 +50,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
-import springfox.documentation.annotations.ApiIgnore;
 
-import javax.annotation.Resource;
+import jakarta.annotation.Resource;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -60,7 +62,7 @@ import java.util.List;
  * 创建日期:2019-11-28 15:12:32<br/>
  * 历史修订:<br/>
  */
-@Api(tags = {"后端-内容模块接口"})
+@Tag(name = "后端-内容模块接口")
 @Controller("cmsContentAction")
 @RequestMapping("/${ms.manager.path}/cms/content")
 public class ContentAction extends BaseAction {
@@ -83,7 +85,7 @@ public class ContentAction extends BaseAction {
     /**
      * 返回主界面index
      */
-    @ApiIgnore
+    @Hidden
     @GetMapping("/index")
     public String index() {
         return "/cms/content/index";
@@ -92,7 +94,7 @@ public class ContentAction extends BaseAction {
     /**
      * 返回主界面main
      */
-    @ApiIgnore
+    @Hidden
     @GetMapping("/main")
     public String main() {
         return "/cms/content/main";
@@ -103,20 +105,20 @@ public class ContentAction extends BaseAction {
      *
      * @param content 文章实体
      */
-    @ApiOperation(value = "查询文章列表接口")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "contentTitle", value = "文章标题", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryId", value = "所属栏目", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentType", value = "文章类型", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentDisplay", value = "是否显示,0:显示 1:不显示", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentAuthor", value = "文章作者", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentSource", value = "文章来源", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentDatetime", value = "发布时间", required = false, paramType = "query"),
+    @Operation(summary =  "查询文章列表接口")
+    @Parameters({
+            @Parameter(name = "contentTitle", description = "文章标题", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryId", description = "所属栏目", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentType", description = "文章类型", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentDisplay", description = "是否显示,0:显示 1:不显示", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentAuthor", description = "文章作者", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentSource", description = "文章来源", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentDatetime", description = "发布时间", required =  false, in = ParameterIn.QUERY),
     })
     @RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST})
     @ResponseBody
     @RequiresPermissions("cms:content:view")
-    public ResultData list(@ModelAttribute @ApiIgnore ContentBean content) {
+    public ResultData list(@ModelAttribute @Parameter(hidden = true) ContentBean content) {
         // 检查SQL注入
         SqlInjectionUtil.filterContent(content.getCategoryId());
         BasicUtil.startPage();
@@ -127,7 +129,7 @@ public class ContentAction extends BaseAction {
     /**
      * 返回编辑界面content_form
      */
-    @ApiIgnore
+    @Hidden
     @GetMapping("/form")
     public String form(@ModelAttribute ContentEntity content, ModelMap model) {
         model.addAttribute("appId", BasicUtil.getApp().getAppId());
@@ -139,12 +141,12 @@ public class ContentAction extends BaseAction {
      *
      * @param content 文章实体
      */
-    @ApiOperation(value = "获取文章详情接口")
-    @ApiImplicitParam(name = "id", value = "编号", required = true, paramType = "query")
+    @Operation(summary =  "获取文章详情接口")
+    @Parameter(name = "id", description = "编号", required =  true, in = ParameterIn.QUERY)
     @GetMapping("/get")
     @ResponseBody
     @RequiresPermissions("cms:content:view")
-    public ResultData get(@ModelAttribute @ApiIgnore ContentEntity content) {
+    public ResultData get(@ModelAttribute @Parameter(hidden = true) ContentEntity content) {
         if (content.getId() == null) {
             return ResultData.build().error();
         }
@@ -157,11 +159,11 @@ public class ContentAction extends BaseAction {
      *
      * @param content 文章实体
      */
-    @ApiOperation(value = "根据封面获取文章列表接口")
-    @ApiImplicitParam(name = "categoryId", value = "分类编号", required = true, paramType = "query")
+    @Operation(summary =  "根据封面获取文章列表接口")
+    @Parameter(name = "categoryId", description = "分类编号", required =  true, in = ParameterIn.QUERY)
     @GetMapping("/getFromFengMian")
     @ResponseBody
-    public ResultData getFromFengMian(@ModelAttribute @ApiIgnore ContentEntity content) {
+    public ResultData getFromFengMian(@ModelAttribute @Parameter(hidden = true) ContentEntity content) {
         if (StringUtils.isBlank(content.getCategoryId())) {
             return ResultData.build().error(getResString("err.empty", this.getResString("category.id")));
         }
@@ -178,33 +180,33 @@ public class ContentAction extends BaseAction {
      *
      * @param content 文章实体
      */
-    @ApiOperation(value = "保存文章列表接口")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "contentTitle", value = "文章标题", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "categoryId", value = "所属栏目", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "contentType", value = "文章类型", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentDisplay", value = "是否显示,0:显示 1:不显示", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "contentAuthor", value = "文章作者", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentSource", value = "文章来源", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentDatetime", value = "发布时间", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "contentSort", value = "自定义顺序", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentImg", value = "文章缩略图", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentDescription", value = "描述", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentKeyword", value = "关键字", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentDetails", value = "文章内容", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentOutLink", value = "文章跳转链接地址", required = false, paramType = "query"),
+    @Operation(summary =  "保存文章列表接口")
+    @Parameters({
+            @Parameter(name = "contentTitle", description = "文章标题", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryId", description = "所属栏目", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "contentType", description = "文章类型", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentDisplay", description = "是否显示,0:显示 1:不显示", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "contentAuthor", description = "文章作者", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentSource", description = "文章来源", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentDatetime", description = "发布时间", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "contentSort", description = "自定义顺序", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentImg", description = "文章缩略图", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentDescription", description = "描述", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentKeyword", description = "关键字", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentDetails", description = "文章内容", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentOutLink", description = "文章跳转链接地址", required =  false, in = ParameterIn.QUERY),
     })
     @PostMapping("/save")
     @ResponseBody
     @LogAnn(title = "保存文章", businessType = BusinessTypeEnum.INSERT)
     @RequiresPermissions("cms:content:save")
-    public ResultData save(@ModelAttribute @ApiIgnore ContentEntity content) {
+    public ResultData save(@ModelAttribute @Parameter(hidden = true) ContentEntity content) {
         //验证缩略图参数值是否合法
         if (content.getContentImg() == null || !content.getContentImg().matches("^\\[.{1,}]$")) {
             content.setContentImg("");
         }
         //验证文章标题的值是否合法
-        if (StringUtil.isBlank(content.getContentTitle())) {
+        if (StringUtils.isBlank(content.getContentTitle())) {
             return ResultData.build().error(getResString("err.empty", this.getResString("content.title")));
         }
         if (!StringUtil.checkLength(content.getContentTitle() + "", 0, 200)) {
@@ -237,7 +239,7 @@ public class ContentAction extends BaseAction {
             return ResultData.build().error(getResString("err.length", this.getResString("content.type"), "0", "20"));
         }
         //验证发布时间的值是否合法
-        if (StringUtil.isBlank(content.getContentDatetime())) {
+        if (content.getContentDatetime()==null) {
             return ResultData.build().error(getResString("err.empty", this.getResString("content.datetime")));
         }
         contentBiz.save(content);
@@ -247,9 +249,9 @@ public class ContentAction extends BaseAction {
     /**
      * @param contents 文章实体
      */
-    @ApiOperation(value = "批量删除文章列表接口")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "contents", value = "文章集合", allowMultiple = true, dataType = "ContentEntity", required = true)
+    @Operation(summary =  "批量删除文章列表接口")
+    @Parameters({
+            @Parameter(name = "contents", description = "文章集合", schema = @Schema(allOf = ContentEntity.class), required = true)
 
     })
     @PostMapping("/delete")
@@ -283,34 +285,34 @@ public class ContentAction extends BaseAction {
      *
      * @param content 文章实体
      */
-    @ApiOperation(value = "更新文章列表接口")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "编号", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "contentTitle", value = "文章标题", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "categoryId", value = "所属栏目", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "contentType", value = "文章类型", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentDisplay", value = "是否显示,0:显示 1:不显示", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "contentAuthor", value = "文章作者", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentSource", value = "文章来源", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentDatetime", value = "发布时间", required = true, paramType = "query"),
-            @ApiImplicitParam(name = "contentSort", value = "自定义顺序", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentImg", value = "文章缩略图", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentDescription", value = "描述", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentKeyword", value = "关键字", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentDetails", value = "文章内容", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "contentOutLink", value = "文章跳转链接地址", required = false, paramType = "query"),
+    @Operation(summary =  "更新文章列表接口")
+    @Parameters({
+            @Parameter(name = "id", description = "编号", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "contentTitle", description = "文章标题", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryId", description = "所属栏目", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "contentType", description = "文章类型", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentDisplay", description = "是否显示,0:显示 1:不显示", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "contentAuthor", description = "文章作者", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentSource", description = "文章来源", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentDatetime", description = "发布时间", required =  true, in = ParameterIn.QUERY),
+            @Parameter(name = "contentSort", description = "自定义顺序", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentImg", description = "文章缩略图", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentDescription", description = "描述", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentKeyword", description = "关键字", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentDetails", description = "文章内容", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "contentOutLink", description = "文章跳转链接地址", required =  false, in = ParameterIn.QUERY),
     })
     @PostMapping("/update")
     @ResponseBody
     @LogAnn(title = "更新文章", businessType = BusinessTypeEnum.UPDATE)
     @RequiresPermissions("cms:content:update")
-    public ResultData update(@ModelAttribute @ApiIgnore ContentEntity content) {
+    public ResultData update(@ModelAttribute @Parameter(hidden = true) ContentEntity content) {
         //验证缩略图参数值是否合法
         if (content.getContentImg() == null || !content.getContentImg().matches("^\\[.{1,}]$")) {
             content.setContentImg("");
         }
         //验证文章标题的值是否合法
-        if (StringUtil.isBlank(content.getContentTitle())) {
+        if (StringUtils.isBlank(content.getContentTitle())) {
             return ResultData.build().error(getResString("err.empty", this.getResString("content.title")));
         }
         if (!StringUtil.checkLength(content.getContentTitle() + "", 0, 200)) {
@@ -343,7 +345,7 @@ public class ContentAction extends BaseAction {
             return ResultData.build().error(getResString("err.length", this.getResString("content.type"), "0", "20"));
         }
         //验证发布时间的值是否合法
-        if (StringUtil.isBlank(content.getContentDatetime())) {
+        if (content.getContentDatetime()==null) {
             return ResultData.build().error(getResString("err.empty", this.getResString("content.datetime")));
         }
         contentBiz.saveOrUpdate(content);

+ 81 - 0
src/main/java/net/mingsoft/cms/action/EditorAction.java

@@ -0,0 +1,81 @@
+/**
+ * The MIT License (MIT)
+ * Copyright (c) 2012-present 铭软科技(mingsoft.net)
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * <p>
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ * <p>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+package net.mingsoft.cms.action;
+
+import cn.hutool.core.map.MapUtil;
+import io.swagger.v3.oas.annotations.Hidden;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
+import net.mingsoft.config.MultipartProperties;
+import net.mingsoft.mdiy.util.ConfigUtil;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 百度编辑器后台上传<br>
+ * 由于百度编辑器在现如今官方都已经不再维护,推荐各位使用我们MStore中新推出的编辑器插件;
+ * @author 铭软开发团队
+ * @date 2019年7月16日
+ * 历史修订 2022-1-21 新增normalize(),
+ * editor()方法过滤非法上传路径
+ *
+ * 百度编辑器后台上传,兼容文件上传配置的上传大小
+ */
+
+
+@Hidden
+@Controller("managerEditorAction")
+@RequestMapping("/${ms.manager.path}")
+public class EditorAction extends BaseAction{
+
+
+    @Resource
+    private MultipartProperties multipartProperties;
+
+    @ResponseBody
+    @RequestMapping(value = "/editor", method = {RequestMethod.GET, RequestMethod.POST})
+    public String editor(MultipartFile upfile, HttpServletRequest request, String version) {
+
+        Map uploadConfig = ConfigUtil.getMap("文件上传配置");
+        long maxFileSize = multipartProperties.getMaxFileSize();
+        Map<String, Object> map = new HashMap<>();
+        // 兼容其他版本的上传配置
+        if (MapUtil.isNotEmpty(uploadConfig)){
+            map.put("imageMaxSize", MapUtil.getLong(uploadConfig,"imageSize") * 1000);
+            map.put("videoMaxSize", MapUtil.getLong(uploadConfig,"videoSize") * 1000);
+            map.put("fileMaxSize", MapUtil.getLong(uploadConfig,"fileSize") * 1000);
+        }else {
+            // 控制大小
+            map.put("imageMaxSize", maxFileSize);
+            map.put("videoMaxSize", maxFileSize);
+            map.put("fileMaxSize", maxFileSize);
+        }
+
+        return exec(request,upfile,map,version);
+    }
+
+}

+ 19 - 19
src/main/java/net/mingsoft/cms/action/GeneraterAction.java

@@ -32,10 +32,11 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.tags.Tag;
 import net.mingsoft.base.entity.ResultData;
 import net.mingsoft.basic.annotation.LogAnn;
 import net.mingsoft.basic.bean.EUListBean;
@@ -61,10 +62,9 @@ import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
-import springfox.documentation.annotations.ApiIgnore;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -79,7 +79,7 @@ import java.util.stream.Collectors;
  * @date: 2018年1月31日 下午2:52:07
  * @Copyright: 2018 www.mingsoft.net Inc. All rights reserved.
  */
-@Api(tags={"后端-静态化"})
+@Tag(name = "后端-静态化")
 @Controller("cmsGenerater")
 @RequestMapping("/${ms.manager.path}/cms/generate")
 @Scope("request")
@@ -123,14 +123,14 @@ public class GeneraterAction extends BaseAction {
      * 目前栏目作为一个公共数据,方便以后拓展其他业务
      * @param category 分类实体
      */
-    @ApiOperation(value = "查询分类列表接口")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "categoryTitle", value = "栏目管理名称", required = false, paramType = "query"),
-            @ApiImplicitParam(name = "categoryParentId", value = "父类型编号", required = false, paramType = "query"),
+    @Operation(summary =  "查询分类列表接口")
+    @Parameters({
+            @Parameter(name = "categoryTitle", description = "栏目管理名称", required =  false, in = ParameterIn.QUERY),
+            @Parameter(name = "categoryParentId", description = "父类型编号", required =  false, in = ParameterIn.QUERY),
     })
     @RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST})
     @ResponseBody
-    public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category) {
+    public ResultData list(@ModelAttribute @Parameter(hidden = true) CategoryEntity category) {
         List categoryList = categoryBiz.list(new LambdaQueryWrapper<CategoryEntity>(category));
         return ResultData.build().success(new EUListBean(categoryList, categoryList.size()));
     }
@@ -141,7 +141,7 @@ public class GeneraterAction extends BaseAction {
      * @param request
      * @param response
      */
-    @ApiOperation(value = "生成主页接口")
+    @Operation(summary =  "生成主页接口")
     @RequestMapping(value = "/generateIndex", method = {RequestMethod.GET, RequestMethod.POST})
     @RequiresPermissions("cms:generate:index")
     @LogAnn(title = "生成主页", businessType = BusinessTypeEnum.UPDATE)
@@ -177,7 +177,7 @@ public class GeneraterAction extends BaseAction {
      * @param response
      * @param categoryId
      */
-    @ApiOperation(value = "生成栏目接口")
+    @Operation(summary =  "生成栏目接口")
     @RequestMapping(value = "/{categoryId}/generateColumn", method = {RequestMethod.GET, RequestMethod.POST})
     @LogAnn(title = "生成栏目", businessType = BusinessTypeEnum.UPDATE)
     @RequiresPermissions("cms:generate:column")
@@ -269,7 +269,7 @@ public class GeneraterAction extends BaseAction {
      * @param response
      * @param columnId
      */
-    @ApiOperation(value = "生成文章接口")
+    @Operation(summary =  "生成文章接口")
     @RequestMapping(value = "/{columnId}/generateArticle", method = {RequestMethod.GET, RequestMethod.POST})
     @RequiresPermissions("cms:generate:article")
     @LogAnn(title = "生成文章", businessType = BusinessTypeEnum.UPDATE)
@@ -351,7 +351,7 @@ public class GeneraterAction extends BaseAction {
      * @param request
      * @return
      */
-    @ApiOperation(value = "预览主页接口")
+    @Operation(summary =  "预览主页接口")
     @RequestMapping(value = "/{position}/viewIndex", method = {RequestMethod.GET, RequestMethod.POST})
     public String viewIndex(HttpServletRequest request, @PathVariable String position, HttpServletResponse response) {
         AppEntity app = BasicUtil.getApp();
@@ -368,8 +368,8 @@ public class GeneraterAction extends BaseAction {
      *
      * @param request 响应
      */
-    @ApiOperation(value = "删除页面")
-    @ApiImplicitParam(name = "fileName", value = "主页名称", required = true, paramType = "query")
+    @Operation(summary =  "删除页面")
+    @Parameter(name = "fileName", description = "主页名称", required =  true, in = ParameterIn.QUERY)
     @LogAnn(title = "删除页面", businessType = BusinessTypeEnum.DELETE)
     @PostMapping("/delete")
     @ResponseBody

+ 30 - 30
src/main/java/net/mingsoft/cms/action/web/CategoryAction.java

@@ -22,10 +22,11 @@
 
 package net.mingsoft.cms.action.web;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.tags.Tag;
 import net.mingsoft.base.entity.ResultData;
 import net.mingsoft.basic.bean.EUListBean;
 import net.mingsoft.basic.util.BasicUtil;
@@ -34,7 +35,6 @@ import net.mingsoft.cms.entity.CategoryEntity;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
-import springfox.documentation.annotations.ApiIgnore;
 
 import java.util.List;
 /**
@@ -43,7 +43,7 @@ import java.util.List;
  * 创建日期:2019-11-28 15:12:32<br/>
  * 历史修订:<br/>
  */
-@Api(tags={"前端-内容模块接口"})
+@Tag(name = "前端-内容模块接口")
 @Controller("WebcmsCategoryAction")
 @RequestMapping("/cms/category")
 public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
@@ -59,30 +59,30 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
 	 * 查询分类列表
 	 * @param category 分类实体
 	 */
-	@ApiOperation(value = "查询分类列表接口")
-	@ApiImplicitParams({
-    	@ApiImplicitParam(name = "id", value = "栏目管理ID", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryTitle", value = "栏目管理名称", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryShortTitle", value = "栏目管理副标题", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryPinyin", value = "栏目管理别名", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryId", value = "所属栏目id", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryType", value = "栏目管理属性", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryListUrl", value = "列表模板", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryUrl", value = "内容模板", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryKeyword", value = "栏目管理关键字", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryDescrip", value = "栏目管理描述", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryDiyUrl", value = "自定义链接", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "mdiyModelId", value = "文章管理的内容模型id", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "dictId", value = "字典对应编号", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryFlag", value = "栏目属性", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryPath", value = "栏目路径", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "categoryParentIds", value = "父类型编号", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "leaf", value = "叶子节点", required =false,paramType="query"),
-    	@ApiImplicitParam(name = "topId", value = "顶级id", required =false,paramType="query"),
+	@Operation(summary = "查询分类列表接口")
+	@Parameters({
+    	@Parameter(name = "id", description = "栏目管理ID", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryTitle", description = "栏目管理名称", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryShortTitle", description = "栏目管理副标题", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryPinyin", description = "栏目管理别名", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryId", description = "所属栏目id", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryType", description = "栏目管理属性", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryListUrl", description = "列表模板", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryUrl", description = "内容模板", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryKeyword", description = "栏目管理关键字", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryDescrip", description = "栏目管理描述", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryDiyUrl", description = "自定义链接", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "mdiyModelId", description = "文章管理的内容模型id", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "dictId", description = "字典对应编号", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryFlag", description = "栏目属性", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryPath", description = "栏目路径", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "categoryParentIds", description = "父类型编号", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "leaf", description = "叶子节点", required = false, in = ParameterIn.QUERY),
+    	@Parameter(name = "topId", description = "顶级id", required = false, in = ParameterIn.QUERY),
     })
 	@PostMapping(value="/list")
 	@ResponseBody
-	public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category) {
+	public ResultData list(@ModelAttribute @Parameter(hidden = true) CategoryEntity category) {
 		BasicUtil.startPage();
 		category.setSqlWhere("");
 		List categoryList = categoryBiz.query(category);
@@ -94,11 +94,11 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
 	 * 获取分类
 	 * @param category 分类实体
 	 */
-	@ApiOperation(value = "获取分类列表接口")
-    @ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query")
+	@Operation(summary =  "获取分类列表接口")
+    @Parameter(name = "id", description = "编号", required = true, in = ParameterIn.QUERY)
 	@GetMapping("/get")
 	@ResponseBody
-	public ResultData get(@ModelAttribute @ApiIgnore CategoryEntity category){
+	public ResultData get(@ModelAttribute @Parameter(hidden = true) CategoryEntity category){
 		if(category.getId()==null) {
 			return ResultData.build().error();
 		}

+ 20 - 20
src/main/java/net/mingsoft/cms/action/web/ContentAction.java

@@ -24,10 +24,13 @@ package net.mingsoft.cms.action.web;
 
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import net.mingsoft.base.entity.ResultData;
 import net.mingsoft.basic.bean.EUListBean;
 import net.mingsoft.basic.util.BasicUtil;
@@ -48,10 +51,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
-import springfox.documentation.annotations.ApiIgnore;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 import java.util.*;
 
 /**
@@ -60,7 +60,7 @@ import java.util.*;
  * 创建日期:2019-11-28 15:12:32<br/>
  * 历史修订:<br/>
  */
-@Api(tags={"前端-内容模块接口"})
+@Tag(name="前端-内容模块接口")
 @Controller("WebcmsContentAction")
 @RequestMapping("/cms/content")
 public class ContentAction extends net.mingsoft.cms.action.BaseAction{
@@ -85,12 +85,12 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
 	 * 查询文章列表接口
 	 * @return
 	 */
-	@ApiOperation(value = "查询文章列表接口")
-	@ApiImplicitParams({
-			@ApiImplicitParam(name = "typeid", value = "所属栏目", required =true,paramType="query"),
-			@ApiImplicitParam(name = "pageNo", value = "页码", required =false,paramType="query"),
-			@ApiImplicitParam(name = "size", value = "一页显示数量", required =false,paramType="query"),
-			@ApiImplicitParam(name = "orderby", value = "排序", required =false,paramType="query"),
+	@Operation(summary = "查询文章列表接口")
+	@Parameters({
+			@Parameter(name = "typeid", description = "所属栏目", required =true, in= ParameterIn.QUERY),
+			@Parameter(name = "pageNo", description = "页码", required =false, in= ParameterIn.QUERY),
+			@Parameter(name = "size", description = "一页显示数量", required =false, in= ParameterIn.QUERY),
+			@Parameter(name = "orderby", description = "排序", required =false, in= ParameterIn.QUERY),
     })
 	@GetMapping(value = "/list")
 	@ResponseBody
@@ -147,11 +147,11 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
 	 * @param content 文章
 	 * @return
 	 */
-	@ApiOperation(value = "获取文章列表接口")
-    @ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query")
+	@Operation(summary =  "获取文章列表接口")
+    @Parameter(name = "id", description = "编号", required = true, in = ParameterIn.QUERY)
 	@GetMapping("/get")
 	@ResponseBody
-	public ResultData get(@ModelAttribute @ApiIgnore ContentEntity content){
+	public ResultData get(@ModelAttribute @Parameter(hidden = true) ContentEntity content){
 		if(content.getId()==null) {
 			return ResultData.build().error(getResString("err.empty",this.getResString("id")));
 		}
@@ -182,12 +182,12 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
 	 * @param contentId 文章编号
 	 * @return
 	 */
-	@ApiOperation(value = "查看文章点击数")
-	@ApiImplicitParam(name = "contentId", value = "文章编号", required = true,paramType="path")
+	@Operation(summary =  "查看文章点击数")
+	@Parameter(name = "contentId", description = "文章编号", required = true, in = ParameterIn.PATH)
 	// 由于适配增加了对clob序列化处理,此处需要指定响应头
 	@GetMapping(value = "/{contentId}/hit", produces = "application/javascript")
 	@ResponseBody
-	public String hit(@PathVariable @ApiIgnore String contentId) {
+	public String hit(@PathVariable @Parameter(hidden = true) String contentId) {
 		if(StringUtils.isEmpty(contentId)){
 			return "document.write(0)";
 		}

+ 86 - 0
src/main/java/net/mingsoft/cms/action/web/EditorAction.java

@@ -0,0 +1,86 @@
+/**
+ * The MIT License (MIT)
+ * Copyright (c) 2012-present 铭软科技(mingsoft.net)
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * <p>
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ * <p>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+package net.mingsoft.cms.action.web;
+
+import cn.hutool.core.map.MapUtil;
+import cn.hutool.json.JSONUtil;
+import io.swagger.v3.oas.annotations.Hidden;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletRequest;
+import net.mingsoft.cms.action.BaseAction;
+import net.mingsoft.config.MSProperties;
+import net.mingsoft.config.MultipartProperties;
+import net.mingsoft.mdiy.util.ConfigUtil;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 百度编辑器上传<br>
+ * 由于百度编辑器在现如今官方都已经不再维护,推荐各位使用我们MStore中新推出的编辑器插件;
+ * @author 铭软开发团队
+ * @date 2019年7月16日
+ * 历史修订 2022-1-21 新增normalize(),
+ * editor()方法过滤非法上传路径
+ *
+ * 百度编辑器前端,兼容文件上传配置的上传大小
+ */
+@Hidden
+@Controller("webEditorAction")
+@RequestMapping("/")
+public class EditorAction extends BaseAction {
+
+    @Resource
+    private MultipartProperties multipartProperties;
+
+    @ResponseBody
+    @RequestMapping(value = "editor", method = {RequestMethod.GET, RequestMethod.POST})
+    public String editor(MultipartFile upfile,HttpServletRequest request, String version) {
+        boolean enableWeb = MSProperties.upload.enableWeb;
+
+        Map uploadConfig = ConfigUtil.getMap("文件上传配置");
+        long maxFileSize = multipartProperties.getMaxFileSize();
+        // 兼容其他版本的上传配置
+        if (MapUtil.isNotEmpty(uploadConfig)){
+            enableWeb = Boolean.parseBoolean(String.valueOf(uploadConfig.get("uploadEnable")));
+            maxFileSize = MapUtil.getLong(uploadConfig,"webFileSize") * 1000;
+        }
+        if (!enableWeb) {
+            HashMap<String, String> map = new HashMap<>();
+            map.put("state","配置不允许前端上传文件");
+            return JSONUtil.toJsonStr(map);
+        }
+        Map<String, Object> map = new HashMap<>();
+
+        // 控制大小
+        map.put("imageMaxSize", maxFileSize);
+        map.put("videoMaxSize", maxFileSize);
+        map.put("fileMaxSize", maxFileSize);
+
+        return exec(request,upfile,map,version);
+    }
+
+}

+ 4 - 4
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java

@@ -27,6 +27,7 @@ import cn.hutool.json.JSONUtil;
 import freemarker.core.ParseException;
 import freemarker.template.MalformedTemplateNameException;
 import freemarker.template.TemplateNotFoundException;
+import io.swagger.v3.oas.annotations.Hidden;
 import net.mingsoft.base.constant.Const;
 import net.mingsoft.basic.util.BasicUtil;
 import net.mingsoft.cms.biz.ICategoryBiz;
@@ -45,10 +46,9 @@ import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
-import springfox.documentation.annotations.ApiIgnore;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
@@ -63,7 +63,7 @@ import java.util.Map;
  * @date 2018年12月17日
  * @date 2021年8月26日取消默认search.htm
  */
-@ApiIgnore
+@Hidden
 @Controller("dynamicPageAction")
 @RequestMapping("/mcms")
 public class MCmsAction extends net.mingsoft.cms.action.BaseAction {

+ 1 - 0
src/main/java/net/mingsoft/cms/biz/IContentBiz.java

@@ -83,4 +83,5 @@ public interface IContentBiz extends IBaseBiz<ContentEntity> {
      */
     Map get(Map map);
 
+
 }

+ 3 - 8
src/main/java/net/mingsoft/cms/biz/impl/CategoryBizImpl.java

@@ -22,13 +22,10 @@
 
 package net.mingsoft.cms.biz.impl;
 
-import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import net.mingsoft.base.biz.impl.BaseBizImpl;
 import net.mingsoft.base.dao.IBaseDao;
 import net.mingsoft.basic.util.PinYinUtil;
@@ -37,7 +34,6 @@ import net.mingsoft.cms.constant.e.CategoryTypeEnum;
 import net.mingsoft.cms.dao.ICategoryDao;
 import net.mingsoft.cms.dao.IContentDao;
 import net.mingsoft.cms.entity.CategoryEntity;
-import net.mingsoft.cms.entity.ContentEntity;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -45,7 +41,6 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  * 分类管理持久化层
@@ -187,8 +182,8 @@ public class CategoryBizImpl extends BaseBizImpl<ICategoryDao, CategoryEntity> i
         if (StringUtils.isEmpty(entity.getCategoryParentIds())) {
             entity.setCategoryParentIds(null);
         }
-        categoryDao.updateEntity(entity);
-//        categoryDao.updateById(entity);
+        //categoryDao.updateEntity(entity); 过期
+        categoryDao.updateById(entity);
         //更新子节点所有父节点id和topid
         //如果本节点的topid为0(顶级栏目),则把自身的id作为子栏目的topid,非0所有的子栏目和本栏目使用同一个topid
         String topId = entity.getTopId();
@@ -216,7 +211,7 @@ public class CategoryBizImpl extends BaseBizImpl<ICategoryDao, CategoryEntity> i
                 //删除子类
                 ids.add(childrenList.get(i).getId());
             }
-            categoryDao.deleteBatchIds(ids);
+            categoryDao.deleteByIds(ids);
             // 删除文章
             contentDao.deleteEntityByCategoryIds(ids.toArray(new String[ids.size()]));
 

+ 10 - 11
src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java

@@ -33,7 +33,6 @@ import net.mingsoft.base.dao.IBaseDao;
 import net.mingsoft.cms.bean.CategoryBean;
 import net.mingsoft.cms.bean.ContentBean;
 import net.mingsoft.cms.biz.IContentBiz;
-import net.mingsoft.cms.dao.ICategoryDao;
 import net.mingsoft.cms.dao.IContentDao;
 import net.mingsoft.cms.entity.ContentEntity;
 import net.mingsoft.mdiy.biz.ITagBiz;
@@ -65,16 +64,12 @@ public class ContentBizImpl  extends BaseBizImpl<IContentDao, ContentEntity> imp
 
 	@Autowired
 	private IContentDao contentDao;
-	/**
-	 * 栏目管理业务层
-	 */
-	@Autowired
-	private ICategoryDao categoryDao;
 
 
 	@Autowired
 	private ITagBiz tagBiz;
 
+
 	@Override
 	protected IBaseDao getDao() {
 		
@@ -111,14 +106,15 @@ public class ContentBizImpl  extends BaseBizImpl<IContentDao, ContentEntity> imp
 		//通过tagSqlBiz获取arclist对应的sql
 		QueryWrapper<TagEntity> tagWrapper = new QueryWrapper<>();
 		tagWrapper.eq("tag_name", "arclist");
-		TagEntity tagEntity = tagBiz.getOne(tagWrapper);
+		TagEntity tagEntity = tagBiz.getOne(tagWrapper,false);
 		String sqlFtl = tagEntity.getTagSql();
-		List<ContentEntity> contentEntities = null;
+		List<Map<String, Object>> contentEntities = null;
 		//通过ParserUtil
 		try {
 			String sql = ParserUtil.rendering(map,sqlFtl);
 			//执行原生的sql
-			contentEntities = (List<ContentEntity>) tagBiz.excuteSql(sql);
+			//contentEntities = (List<ContentEntity>) tagBiz.excuteSql(sql);过期
+			contentEntities = tagBiz.queryForList(sql);
 		} catch (IOException e) {
 			e.printStackTrace();
 		} catch (TemplateException e) {
@@ -132,7 +128,7 @@ public class ContentBizImpl  extends BaseBizImpl<IContentDao, ContentEntity> imp
 		//通过tagSqlBiz获取data对应的sql
 		LambdaQueryWrapper<TagEntity> wrapper = new LambdaQueryWrapper<>();
 		wrapper.eq(TagEntity::getTagName, "data");
-		TagEntity tagEntity = tagBiz.getOne(wrapper);
+		TagEntity tagEntity = tagBiz.getOne(wrapper,false);
 		if (tagEntity == null) {
 			return null;
 		}
@@ -141,7 +137,8 @@ public class ContentBizImpl  extends BaseBizImpl<IContentDao, ContentEntity> imp
 		try {
 			String sql = ParserUtil.rendering(map,sqlFtl);
 			//执行原生的sql
-			List<Map>contentEntities = (List<Map>) tagBiz.excuteSql(sql);
+			//List<Map>contentEntities = (List<Map>) tagBiz.excuteSql(sql);过期
+			List<Map<String, Object>> contentEntities = tagBiz.queryForList(sql);
 			if (CollUtil.isEmpty(contentEntities)) {
 				return null;
 			}
@@ -152,4 +149,6 @@ public class ContentBizImpl  extends BaseBizImpl<IContentDao, ContentEntity> imp
 		}
 		return content;
 	}
+
+
 }

+ 8 - 7
src/main/java/net/mingsoft/cms/entity/CategoryEntity.java

@@ -62,7 +62,7 @@ public class CategoryEntity extends BaseEntity {
     /**
      * 栏目副标题
      */
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    @TableField(updateStrategy = FieldStrategy.ALWAYS)
     private String categoryShortTitle;
     /**
      * 栏目别名
@@ -71,7 +71,8 @@ public class CategoryEntity extends BaseEntity {
     /**
      * 所属栏目
      */
-    @TableField(insertStrategy = FieldStrategy.NOT_EMPTY, updateStrategy = FieldStrategy.NOT_EMPTY, whereStrategy = FieldStrategy.NOT_EMPTY)
+    //@TableField(insertStrategy = FieldStrategy.NOT_EMPTY, updateStrategy = FieldStrategy.NOT_EMPTY, whereStrategy = FieldStrategy.NOT_EMPTY)
+    @TableField(insertStrategy = FieldStrategy.NOT_EMPTY, updateStrategy = FieldStrategy.ALWAYS, whereStrategy = FieldStrategy.NOT_EMPTY)
     private String categoryId;
     /**
      * 栏目管理属性
@@ -84,12 +85,12 @@ public class CategoryEntity extends BaseEntity {
     /**
      * 列表模板
      */
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    @TableField(updateStrategy = FieldStrategy.ALWAYS)
     private String categoryListUrl;
     /**
      * 内容模板
      */
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    @TableField(updateStrategy = FieldStrategy.ALWAYS)
     private String categoryUrl;
     /**
      * 栏目管理关键字
@@ -127,13 +128,13 @@ public class CategoryEntity extends BaseEntity {
     /**
      * 文章管理的内容模型id
      */
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    @TableField(updateStrategy = FieldStrategy.ALWAYS)
     private String mdiyModelId;
 
     /**
      * 栏目管理的内容模型id
      */
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    @TableField(updateStrategy = FieldStrategy.ALWAYS)
     private String mdiyCategoryModelId;
 
     /**
@@ -151,7 +152,7 @@ public class CategoryEntity extends BaseEntity {
     /**
      * 父类型编号
      */
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    @TableField(updateStrategy = FieldStrategy.ALWAYS)
     private String categoryParentIds;
 
     /**

+ 2 - 0
src/main/java/net/mingsoft/cms/entity/ContentEntity.java

@@ -134,6 +134,8 @@ private static final long serialVersionUID = 1574925152617L;
 	 */
 	private Integer hasListHtml;
 
+
+
 	public Integer getContentHit() {
 		return contentHit;
 	}

+ 1 - 2
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java

@@ -43,7 +43,6 @@ import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.servlet.http.HttpServletRequest;
 import java.io.File;
 import java.io.IOException;
 import java.util.*;
@@ -331,7 +330,7 @@ public class CmsParserUtil {
             String finalWritePath = writePath;
             HashMap<Object, Object> cloneMap = MapUtil.newHashMap();
             cloneMap.putAll(parserParams);
-            HttpServletRequest request = SpringUtil.getRequest();
+//            HttpServletRequest request = SpringUtil.getRequest();
             String content = null;
             try {
                 content = ParserUtil.rendering(columnUrl, cloneMap);

+ 8 - 6
src/main/java/net/mingsoft/config/WebConfig.java

@@ -26,6 +26,7 @@ import cn.hutool.json.JSONUtil;
 import com.alibaba.druid.pool.DruidDataSource;
 import com.alibaba.druid.support.spring.stat.BeanTypeAutoProxyCreator;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import jakarta.annotation.Resource;
 import net.mingsoft.basic.filter.XSSEscapeFilter;
 import net.mingsoft.basic.interceptor.ActionInterceptor;
 import net.mingsoft.mdiy.biz.IConfigBiz;
@@ -43,12 +44,8 @@ import org.springframework.core.Ordered;
 import org.springframework.http.converter.HttpMessageConverter;
 import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
 import org.springframework.web.context.request.RequestContextListener;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import org.springframework.web.servlet.config.annotation.*;
 
-import javax.annotation.Resource;
 import java.io.File;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -103,6 +100,12 @@ public class WebConfig implements WebMvcConfigurer {
     }
 
     @Override
+    public void configurePathMatch(PathMatchConfigurer configurer) {
+        // 启用后缀模式匹配
+        configurer.setUseSuffixPatternMatch(true);
+    }
+
+    @Override
     public void addResourceHandlers(ResourceHandlerRegistry registry) {
         String uploadMapping = MSProperties.upload.mapping;
         String uploadFolderPath = MSProperties.upload.path;
@@ -192,7 +195,6 @@ public class WebConfig implements WebMvcConfigurer {
      */
     @Override
     public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
-        // TODO Auto-generated method stub
         converters.add(mappingJackson2HttpMessageConverter);
         WebMvcConfigurer.super.configureMessageConverters(converters);
 

+ 18 - 15
src/main/resources/application.yml

@@ -10,6 +10,8 @@ server:
   error:
     include-exception: true
     include-message: always
+  tomcat:
+    max-swallow-size: 1GB # tomcat容器最大请求大小,可按需修改(一般比最大文件上传大小大一些就行),避免上传文件超出最大限制时容器中断请求,导致获取不到异常信息
 
 #  ssl: #https证书配置 配置了之后只能通过https访问应用
 #    key-store: xxx.pfx 证书文件,证书文件格式具体参考证书分发平台
@@ -18,16 +20,20 @@ server:
 logging:
   level:
     net.mingsoft: debug
-    springfox.documentation: error
+    org.springdoc: error
   config: classpath:log4j-spring.xml
 
-springfox:
-  documentation:
-    auto-startup: false #启用swagger功能,false 将不会启用swagger-ui和api-doc 生产的时候务必关掉
-    enabled: false #启用swagger文档(启用时需要swagger功能也开启 auto-startup: true),生产的时候务必关掉 访问地址:http://ip|域名/项目发布名/swagger-ui/
+springdoc:
+  api-docs:
+    enabled: true #启用swagger功能,false 将不会启用swagger-ui和api-doc 生产的时候务必关掉
+  swagger-ui:
+    enabled: true #启用swagger文档(启用时需要swagger功能也开启 api-docs.enable: true),生产的时候务必关掉 访问地址:http://ip|域名/项目发布名/swagger-ui.html
+    doc-expansion: none #默认不展开
+    tags-sorter: alpha   # 按字母顺序排列标签
+    operations-sorter: alpha # 按字母顺序排列操作
+  packages-to-scan: net.mingsoft #扫描包,多个包用逗号隔开
 
 ms:
-  #  mstore-url: http://wtp.i.mingsoft.net
   #scheme: https #解决使用代理服务器代理应用时标签解析域名依旧为http的问题
   xss:
     enable: true #xss过滤器的开关
@@ -43,7 +49,7 @@ ms:
 
   manager:
     path: /ms #后台访问的路径,如:http://项目/ms/login.do,生产的时候建议修改
-    check-code: false #默认开启验证码验证,false验证码不验证
+    check-code: true #默认开启验证码验证,false验证码不验证
 
   upload:
     enable-web: true  #启用web层的上传
@@ -54,11 +60,11 @@ ms:
     back-up: /upload_back
     multipart:
       #最大上传文件大小 单位:KB
-      max-file-size: 10240
+      max-file-size: 1024000
       #文件暂存临时目录
       upload-temp-dir: temp
       #临时文件大小
-      max-in-memory-size: 10240
+      max-in-memory-size: 1024000
       #总上传最大大小 单位:KB -1禁用
       max-request-size: -1
 
@@ -70,8 +76,6 @@ ms:
     circle: 10 #干扰线条数,值越大越不容易辨别
 
 spring:
-  main:
-    allow-circular-references: true
   datasource:
     druid:
       initialSize: 5 #初始连接数,默认0
@@ -82,10 +86,10 @@ spring:
       testOnBorrow: true #设置从连接池获取连接时是否检查连接有效性,true检查,false不检查
       testOnReturn: true #设置从连接池归还连接时是否检查连接有效性,true检查,false不检查
       poolPreparedStatements: true #可以支持PSCache(提升写入、查询效率)
-      filters: stat,wall #配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+#      filters: stat,wall #配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
       keepAlive: true #保持长连接
       stat-view-servlet:
-        enabled: false #启用druid监控
+        enabled: true #启用druid监控
   profiles:
     active: dev
   cache:
@@ -102,8 +106,7 @@ spring:
       exclude: static/**,WEB-INF/**
   servlet:
     multipart:
-      max-request-size: 100MB
-      enabled: false
+      enabled: true
   freemarker:
     suffix: .ftl
     charset: UTF-8

+ 17 - 5
src/main/webapp/WEB-INF/manager/cms/category/form.ftl

@@ -170,8 +170,7 @@
                                                    :label="item.modelName"></el-option>
                                     </el-select>
                                     <div class="ms-form-tip">
-                                        文章字段不满足,使用<b>代码生成器</b>生成<b>自定义模型</b>来扩展,<br/>
-                                        大概步骤:<i>代码生成器->复制自定义模型->打开系统后台的自定义管理->选择自定义模型->导入->文章 自定义模型 绑定</i>
+                                        如果发布时候文章字段信息不够,可以采用铭飞代码生成器生成自定义模型,再通过“自定义模块->自定义模型->导入”功能导入模型,注意类型是文章。如果栏目下有文章则不允许修改绑定的模型
                                     </div>
                                 </el-form-item>
 
@@ -338,7 +337,20 @@
                             </el-upload>
                         </el-form-item>
                     </el-form>
-
+                    <el-dialog
+                            v-model="dialogVisible"
+                            title="Tips"
+                            width="500">
+                        <span>This is a message</span>
+                        <template #footer>
+                            <div class="dialog-footer">
+                                <el-button @click="dialogVisible = false">Cancel</el-button>
+                                <el-button type="primary" @click="dialogVisible = false">
+                                    Confirm
+                                </el-button>
+                            </div>
+                        </template>
+                    </el-dialog>
                 </el-tab-pane>
             </el-tabs>
         </el-scrollbar>
@@ -366,6 +378,7 @@
                 })
             }
             return {
+                dialogVisible: false,
                 activeName: 'form',
                 //自定义模型实例
                 model: undefined,
@@ -816,8 +829,7 @@
             },
             //categoryImg文件上传失败回调
             categoryImgError: function (response, file, fileList) {
-                response = response.toString().replace("Error: ","")
-                response = JSON.parse(response);
+                response = JSON.parse(response.message);
                 this.$notify({
                     title: '失败',
                     message: response.msg,

+ 10 - 9
src/main/webapp/WEB-INF/manager/cms/content/form.ftl

@@ -273,9 +273,10 @@
                                     标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.descrip}</a>,用于SEO优化
                                 </div>
                             </el-form-item>
-                            <el-form-item label="文章内容" prop="contentDetails" v-loading="editorHiden">
+                            <el-form-item label="文章内容" prop="contentDetails" v-loading="editorHidden">
                                 <vue-ueditor-wrap style="line-height: 0px"
-                                                  v-if="!editorHiden"
+                                                  ref="editor"
+                                                  v-if="!editorHidden"
                                                   v-model="form.contentDetails"
                                                   :config="editorConfig"></vue-ueditor-wrap>
                                 <div class="ms-form-tip">
@@ -309,7 +310,7 @@
                 callback();
             }
             return {
-                editorHiden:true,
+                editorHidden:true,
                 saveDisabled: false,
                 activeName: 'form',
                 //自定义模型实例
@@ -329,7 +330,7 @@
                     maximumWords: 2000,
                     initialFrameWidth: '100%',
                     initialFrameHeight: 400,
-                    serverUrl: ms.base + "/static/plugins/ueditor/1.4.3.3/jsp/editor.do?jsonConfig=%7BvideoUrlPrefix:\'\',fileManagerListPath:\'\',imageMaxSize:204800000,videoMaxSize:204800000,fileMaxSize:204800000,fileUrlPrefix:\'\',imageUrlPrefix:\'\',imagePathFormat:\'/${app.id}/editor/%7Btime%7D\',filePathFormat:\'/${app.id}/editor/%7Btime%7D\',videoPathFormat:\'/${app.id}/editor/%7Btime%7D\'%7D",
+                    serverUrl: ms.manager + "/editor.do?version=1.4.3.3",
                     UEDITOR_HOME_URL: ms.base + '/static/plugins/ueditor/1.4.3.3/'
                 },
                 contentCategoryIdOptions: [],
@@ -460,6 +461,7 @@
                         that.saveDisabled = true; //判断
 
                         var data = JSON.parse(JSON.stringify(that.form));
+
                         // 固定属性顺序为字典顺序
                         if (data.contentType && data.contentType.length > 0) {
                             var orderTypes = [];
@@ -780,8 +782,7 @@
             },
             //contentImg文件上传失败回调
             contentImgError: function (response, file, fileList) {
-                response = response.toString().replace("Error: ","")
-                response = JSON.parse(response);
+                response = JSON.parse(response.message);
                 this.$notify({
                     title: '失败',
                     message: response.msg,
@@ -811,9 +812,9 @@
             },
             //只有在渲染完栏目数据之后才会初始化
             init: function () {
-				var that = this;
+                var that = this;
                 this.form.id = this.id;
-                this.editorHiden = true;
+                this.editorHidden = true;
 
                 //在指定栏目下新增或编辑文章时
                 if (this.categoryId) {
@@ -836,7 +837,7 @@
 
                 setTimeout(()=>{
                     //显示编辑器
-                    that.editorHiden = false;
+                    that.editorHidden = false;
                 },200)
             },
             //复制文章id