he2802 3 年 前
コミット
0797faa12f

+ 6 - 6
zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java

@@ -245,42 +245,42 @@ public class ScheduleController extends BaseController {
         return AjaxResult.success();
     }
 
-    @ApiOperation("学生购买未学习提醒")
+    @ApiOperation("学生购买2天未学习提醒")
     @GetMapping("/buyNotReadToStudentTwo")
     public AjaxResult buyNotReadToStudentTwo(UserQueryBo bo){
         iScheduleService.buyNotReadToStudentTwo(bo);
         return AjaxResult.success();
     }
 
-    @ApiOperation("学生购买未学习提醒")
+    @ApiOperation("学生购买5天未学习提醒")
     @GetMapping("/buyNotReadToStudentFive")
     public AjaxResult buyNotReadToStudentFive(UserQueryBo bo){
         iScheduleService.buyNotReadToStudentFive(bo);
         return AjaxResult.success();
     }
 
-    @ApiOperation("学生购买未学习教务提醒")
+    @ApiOperation("学生购买7天未学习教务提醒")
     @GetMapping("/buyNotReadToTeacher")
     public AjaxResult buyNotReadToTeacher(UserQueryBo bo){
         iScheduleService.buyNotReadToTeacher(bo);
         return AjaxResult.success();
     }
 
-    @ApiOperation("学生长时间未学习提醒")
+    @ApiOperation("学生长时间3天未学习提醒")
     @GetMapping("/longNotReadToStudentThree")
     public AjaxResult longNotReadToStudentThree(UserQueryBo bo){
         iScheduleService.longNotReadToStudentThree(bo);
         return AjaxResult.success();
     }
 
-    @ApiOperation("学生长时间未学习提醒")
+    @ApiOperation("学生长时间5天未学习提醒")
     @GetMapping("/longNotReadToStudentFive")
     public AjaxResult longNotReadToStudentFive(UserQueryBo bo){
         iScheduleService.longNotReadToStudentFive(bo);
         return AjaxResult.success();
     }
 
-    @ApiOperation("学生长时间未学习教务提醒")
+    @ApiOperation("学生长时间7天未学习教务提醒")
     @GetMapping("/longNotReadToTeacher")
     public AjaxResult longNotReadToTeacher(UserQueryBo bo){
         iScheduleService.longNotReadToTeacher(bo);

+ 2 - 2
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java

@@ -126,7 +126,7 @@ public class CommonController extends BaseController {
         else if (allMessage.getMsgType().equals(MessageTypeEnum.MSG_EVENT.getMsgType())) {
             // 是否为订阅事件,即公众号被关注时所触发的事件
             if (EventType.EVENT_SUBSCRIBE.getEventType().equals(allMessage.getEvent())) {
-                System.out.println("关注");
+            //    System.out.println("关注");
                 String openId = allMessage.getFromUserName();
                 wxLoginService.subGzh(openId);
                 // 自动回复欢迎语
@@ -135,7 +135,7 @@ public class CommonController extends BaseController {
             else if (EventType.EVENT_UNSUBSCRIBE.getEventType().equals(allMessage.getEvent())) {
                 String openId = allMessage.getFromUserName();
                 wxLoginService.unsubGzh(openId);
-                System.out.println("取消关注");
+            //    System.out.println("取消关注");
             }
         } else {
             // 暂不支持文本以外的消息回复

+ 1 - 1
zhongzheng-common/pom.xml

@@ -66,7 +66,7 @@
         <dependency>
             <groupId>com.thoughtworks.xstream</groupId>
             <artifactId>xstream</artifactId>
-            <version>1.4.15</version>
+            <version>1.4.17</version>
         </dependency>
 
         <!-- 保利威 -->

+ 2 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/WxLoginService.java

@@ -393,6 +393,8 @@ public class WxLoginService implements IWxLoginService
             JSONObject jsonObject = (JSONObject) JSONObject.parse(resultString);
             if(jsonObject.containsKey("access_token")){
                 accessToken = String.valueOf(jsonObject.get("access_token"));
+                System.out.println("获取");
+                System.out.println(accessToken);
                 if(Validator.isNotEmpty(accessToken)&&!accessToken.equals("null")){
                     redisCache.setCacheObject(key, accessToken,7100, TimeUnit.SECONDS);//7200有效期
                 }

+ 14 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/domain/MessageUtil.java

@@ -1,6 +1,9 @@
 package com.zhongzheng.modules.wx.domain;
 
 import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.security.NoTypePermission;
+import com.thoughtworks.xstream.security.NullPermission;
+import com.thoughtworks.xstream.security.PrimitiveTypePermission;
 import org.dom4j.Document;
 import org.dom4j.DocumentException;
 import org.dom4j.Element;
@@ -9,10 +12,7 @@ import org.dom4j.io.SAXReader;
 import javax.servlet.http.HttpServletRequest;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 public class MessageUtil {
     private final static String XML = "xml";
@@ -77,6 +77,16 @@ public class MessageUtil {
      */
     public static AllMessage xmlToAllMessage(String xmlStr) {
         XStream xStream = new XStream();
+        // clear out existing permissions and set own ones
+        xStream.addPermission(NoTypePermission.NONE);
+        // allow some basics
+        xStream.addPermission(NullPermission.NULL);
+        xStream.addPermission(PrimitiveTypePermission.PRIMITIVES);
+        xStream.allowTypeHierarchy(Collection.class);
+        // allow any type from the same package
+        xStream.allowTypesByWildcard(new String[] {
+                "com.zhongzheng.**"
+        });
         AllMessage allMessage = new AllMessage();
         xStream.aliasType(XML, allMessage.getClass());
         allMessage = (AllMessage) xStream.fromXML(xmlStr);