| | |
| | | System.out.println("接收到机器人发送的加密消息:" + jsonObject.toJSONString()); |
| | | System.out.println("接收到机器人发送的解密后消息:" + decryptedMessage); |
| | | JSONObject decryptedMessageJson = JSONObject.parseObject(decryptedMessage); |
| | | System.out.println("接收到机器人发送的消息是否存在msgtype:" + decryptedMessageJson.containsKey("msgtype")); |
| | | if (decryptedMessageJson.getString("msgtype").equals("text")) { |
| | | return wxcpt.EncryptRobotMsg("{\"msgtype\": \"text\",\"text\": {\"content\": \"消息已收到\"}}", "", nonce); |
| | | System.out.println("接收到机器人发送的消息中的msgtype:" + decryptedMessageJson.getString("msgtype")); |
| | | // return wxcpt.EncryptRobotMsg("{\"msgtype\": \"text\",\"text\": {\"content\": \"消息已收到\"}}", "", nonce); |
| | | return wxcpt.EncryptRobotJsonMsg("{\"msgtype\": \"text\",\"text\": {\"content\": \"消息已收到\"}}", "", nonce); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |