@PostMapping(produces = "application/xml; charset=UTF-8")
public String post(@PathVariable("appId") String appId, @RequestBody String requestBody,
@RequestParam(value = "signature",required = false) String signature,
@RequestParam(value = "timestamp",required = false) String timestamp,
@RequestParam(value = "nonce",required = false) String nonce,
@RequestParam(value = "openid",required = false) String openid,
@RequestParam(value = "encType",required = false) String encType,
@RequestParam(value = "msgSignature",required = false) String msgSignature) {
logger.info("接收微信公众号请求:[openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}],"
+ " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ",
openid, signature, encType, msgSignature, timestamp, nonce, requestBody);
ChatChannel channel = chatChannelService.getFromAppId(appId);
if (channel == null) return null;
// if (!wxMpService.checkSignature(timestamp, nonce, signature)) {
// throw new IllegalArgumentException("非法请求,可能属于伪造的请求!");
// }
WxMpService wxMpService = chatWxService.getWxMpService(appId);
WxMpXmlMessage inMessage = null;
WxMpXmlOutMessage outMessage = null;
String result = null;
if (encType == null) {
inMessage = WxMpXmlMessage.fromXml(requestBody);
} else if ("aes".equalsIgnoreCase(encType)) {
inMessage = WxMpXmlMessage.fromEncryptedXml(requestBody, wxMpService.getWxMpConfigStorage(),
timestamp, nonce, msgSignature);
}
logger.info("接收微信公众号请求解密:{},{}", appId, inMessage);
if (inMessage != null) {
if (inMessage.getMsgType().equals(WxConsts.XmlMsgType.EVENT)) {
return chatWxService.eventHandle(appId, signature, timestamp, nonce, openid, encType, msgSignature, requestBody, inMessage, channel.getAesKey());
} else {
outMessage = chatWxService.msgHandle(appId, inMessage);
}
}
if (encType == null && outMessage != null) {
result = outMessage.toXml();
} else if ("aes".equalsIgnoreCase(encType) && outMessage != null) {
result = outMessage.toEncryptedXml(wxMpService.getWxMpConfigStorage());
}
logger.info("公众号组装回复信息:{}", result);
return result;
}
代码如上:通过被动回复来回复一些内容,为纯文本+超链接。
1.经过测试得到的效果安卓手机和苹果手机收到的内容不一致。安卓从第二个超链接的后面内容会不显示
2.被动回复内容如果带有html标签也就是富文本形式,是否可以被识别到。例如换行,加粗等

你好,提供一个具体的case说明问题和截图
appId :wxf624160c6b51c680
[2025-10-29 11:14:03:917][http-nio-8001-exec-125][INFO ] [c.k.c.c.ChatWxController:50] -- 接收微信公众号请求:[openid=[oHLyzuOmWIJDuxSJ4FR_ioYn4asY], [signature=[3e2e27911b085c4cc62a58efb051a78ec43a3bc5], encType=[null], msgSignature=[null], timestamp=[1761707643], nonce=[1278545105], requestBody=[<xml><ToUserName><![CDATA[gh_480ae39ad610]]></ToUserName><FromUserName><![CDATA[oHLyzuOmWIJDuxSJ4FR_ioYn4asY]]></FromUserName><CreateTime>1761707642</CreateTime><MsgType><![CDATA[text]]></MsgType><Content><![CDATA[工具]]></Content><MsgId>25221588740758977</MsgId><Encrypt><![CDATA[DJ1iPvVCXYLWllfnpwUZSMONbNPEgQtASE6U204cbSO4sIpGpuux8rcOChtoXqpu7NRaZILdJjcWbZ5HZwYqowI/FW+NHsXtClOjhKVqY+E7dqkzxaUGDo6ROokZomygYUujTnse+yX661/w0y5O2xmjPdzmTWinBt8Nc8EWiH5UjwFRsZRqsosa4xeudiJT2yCGpwdZuCFlqSnCkGa0mmkULrYEVir2mzBOCw/ys/eaoQYna6is86ljR7wkWDFRjLF8Tt0gk0ZJCnJfQnSFyCwNmoHVk9I7k1VkYDuE6vGG143NtUrY0wSQhSfjT0yG8VgCe8ltFxuOoHu88FoznkoioejrP2+ip8e7xyd2+iD/uOEFzrStzyKcWDdXkRWuYwF0Hep97+YgbnDBrEZvrfIsU/g0rcVt9XPY9VqLiUo=]]></Encrypt></xml>][2025-10-29 11:14:04:467][http-nio-8001-exec-125][INFO ] [c.k.c.c.ChatWxController:81] -- 公众号组装回复信息:<xml><ToUserName><![CDATA[oHLyzuOmWIJDuxSJ4FR_ioYn4asY]]></ToUserName><FromUserName><![CDATA[gh_480ae39ad610]]></FromUserName><CreateTime>1761707644</CreateTime><MsgType><![CDATA[text]]></MsgType><Content><![CDATA[点击下方链接,选择您想体验的育儿小工具:➡过敏测 | 症状自测帮您了解宝宝过敏风险指数,点击体验↓ <a href="" data-miniprogram-appid="wx853b3ae8d25c1dd3" data-miniprogram-path="pages2025/coMiss/index/index.html?channel=通过公众号访问过敏工具自测">点击跳小程序</a>➡便便小侦探 | 宝宝便便解码一拍秒懂便便信号,新手爸妈不焦虑↓<a href="" data-miniprogram-appid="wx853b3ae8d25c1dd3" data-miniprogram-path="pages2025/stoolTool/index/index?channel=FromOfficialAccount">点击跳小程序</a>1➡儿童测 | 成长曲线轻松追踪宝宝生长情况,点击体验↓<a href="" data-miniprogram-appid="wxcfe3aca0ee1f8e93" data-miniprogram-path="pages/index/index?source=NestleWechat">点击跳小程序</a>]]></Content></xml>appId wxf624160c6b51c680
[2025-10-29 11:22:03:647][http-nio-8001-exec-139][INFO ] [c.k.c.c.ChatWxController:50] -- 接收微信公众号请求:[openid=[oHLyzuAYGTmXctyDqrAbhUYEJNbI], [signature=[12601c15617b0980b4dbfc7e677c1d03e306364e], encType=[null], msgSignature=[null], timestamp=[1761708123], nonce=[987118932], requestBody=[<xml><ToUserName><![CDATA[gh_480ae39ad610]]></ToUserName><FromUserName><![CDATA[oHLyzuAYGTmXctyDqrAbhUYEJNbI]]></FromUserName><CreateTime>1761708122</CreateTime><MsgType><![CDATA[text]]></MsgType><Content><![CDATA[工具]]></Content><MsgId>25221597473214262</MsgId><Encrypt><![CDATA[RP7zGki6J+ms5sRbgR/O2G16y4EC5twHpWllDpBtiUptm0GepLfBX8T3bVhlQhE0TIWVljMUyzYvXXY7S4tqt7CgmX9z0k/q1BrVYEhWHEVhS0fLQVrnWTuX2WIVgLfFTcbiS0B54NzM7iM3okDVBLS3ELVS5aOS8W58E3DWedfmSP80pVOl8ZTCv/r2ebFV7xpU1oX2HxcXsasgWNUZg3HE4kIWV2HtHN9FtMqZV5zgAbSbE6QIgztKZaaCrVJk4zgtHTHzxHTMMUpojOYPFF5zlDloYuZmEAkLoNqz5Bs4OlYvf7EqzroImHwG5RttEGgAym3Be/c5PyHSY83t0c8n1StZ5UF0NCGOwvjXUwwR/rdSrZRYl0sKEkv4GpXbEHa9LlieXsmbjxW2RtJ1FjDyaBL0M2lumTDZenksnec=]]></Encrypt></xml>][2025-10-29 11:22:03:699][http-nio-8001-exec-139][INFO ] [c.k.c.c.ChatWxController:81] -- 公众号组装回复信息:<xml><ToUserName><![CDATA[oHLyzuAYGTmXctyDqrAbhUYEJNbI]]></ToUserName><FromUserName><![CDATA[gh_480ae39ad610]]></FromUserName><CreateTime>1761708123</CreateTime><MsgType><![CDATA[text]]></MsgType><Content><![CDATA[点击下方链接,选择您想体验的育儿小工具:➡过敏测 | 症状自测帮您了解宝宝过敏风险指数,点击体验↓ <a href="" data-miniprogram-appid="wx853b3ae8d25c1dd3" data-miniprogram-path="pages2025/coMiss/index/index.html?channel=通过公众号访问过敏工具自测">点击跳小程序</a>➡便便小侦探 | 宝宝便便解码一拍秒懂便便信号,新手爸妈不焦虑↓<a href="" data-miniprogram-appid="wx853b3ae8d25c1dd3" data-miniprogram-path="pages2025/stoolTool/index/index?channel=FromOfficialAccount">点击跳小程序</a>1➡儿童测 | 成长曲线轻松追踪宝宝生长情况,点击体验↓<a href="" data-miniprogram-appid="wxcfe3aca0ee1f8e93" data-miniprogram-path="pages/index/index?source=NestleWechat">点击跳小程序</a>]]></Content></xml>