xwh %!s(int64=4) %!d(string=hai) anos
pai
achega
415e65d2bc

+ 12 - 7
kmall-admin/src/main/java/com/kmall/admin/Test.java

@@ -12,6 +12,8 @@
  */
 package com.kmall.admin;
 
+import org.springframework.web.util.HtmlUtils;
+
 /**
  * 名称:Test <br>
  * 描述:<br>
@@ -23,14 +25,17 @@ package com.kmall.admin;
 public class Test {
     public static void main(String[] args) {
         //Integer使用equals判断
-        Integer a = 127;
-        Integer b = 127;
-        System.out.println(a == b);
-        Integer c = 129;
-        Integer d = 129;
-        System.out.println(c == d);
+//        Integer a = 127;
+//        Integer b = 127;
+//        System.out.println(a == b);
+//        Integer c = 129;
+//        Integer d = 129;
+//        System.out.println(c == d);
+//
+//        System.out.println(c.equals(d));
+
 
-        System.out.println(c.equals(d));
+        System.out.println(HtmlUtils.htmlUnescape("Baby&amp;Children"));
 
     }
 }

+ 6 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/CategoryController.java

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

+ 1 - 1
kmall-admin/src/main/webapp/js/sale/sale.js

@@ -840,7 +840,7 @@ function openWebSocket() {
         //无法使用wss,浏览器打开WebSocket时报错
         //ws对应http、wss对应https。
         // webSocket = new WebSocket("ws://183.62.225.124:8080/ws/server/"+storeId);
-        webSocket = new WebSocket("ws://localhost:8080//ws/server/"+storeId);
+        webSocket = new WebSocket("ws://localhost:8080/ws/server/"+storeId);
         if (webSocket.readyState === webSocket.CONNECTING) {
             console.log('1.连接正在打开......');
         }