|
@@ -9,10 +9,12 @@ import com.kmall.admin.utils.ParamUtils;
|
|
import com.kmall.common.constant.JxlsXmlTemplateName;
|
|
import com.kmall.common.constant.JxlsXmlTemplateName;
|
|
import com.kmall.common.utils.*;
|
|
import com.kmall.common.utils.*;
|
|
import com.kmall.common.utils.excel.ExcelUtil;
|
|
import com.kmall.common.utils.excel.ExcelUtil;
|
|
|
|
+import org.apache.commons.lang.StringEscapeUtils;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
+import org.springframework.web.util.HtmlUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
@@ -70,6 +72,8 @@ public class CategoryController {
|
|
@RequestMapping("/save")
|
|
@RequestMapping("/save")
|
|
@RequiresPermissions("category:save")
|
|
@RequiresPermissions("category:save")
|
|
public R save(@RequestBody CategoryEntity category) {
|
|
public R save(@RequestBody CategoryEntity category) {
|
|
|
|
+ category.setName(HtmlUtils.htmlUnescape(category.getName()));
|
|
|
|
+ category.setFrontDesc(HtmlUtils.htmlUnescape(category.getFrontDesc()));
|
|
categoryService.save(category);
|
|
categoryService.save(category);
|
|
|
|
|
|
return R.ok();
|
|
return R.ok();
|
|
@@ -81,6 +85,8 @@ public class CategoryController {
|
|
@RequestMapping("/update")
|
|
@RequestMapping("/update")
|
|
@RequiresPermissions("category:update")
|
|
@RequiresPermissions("category:update")
|
|
public R update(@RequestBody CategoryEntity category) {
|
|
public R update(@RequestBody CategoryEntity category) {
|
|
|
|
+ category.setName(HtmlUtils.htmlUnescape(category.getName()));
|
|
|
|
+ category.setFrontDesc(HtmlUtils.htmlUnescape(category.getFrontDesc()));
|
|
categoryService.update(category);
|
|
categoryService.update(category);
|
|
|
|
|
|
return R.ok();
|
|
return R.ok();
|