添加小程序订阅消息接口

This commit is contained in:
xuwenbo
2020-08-13 18:52:47 +08:00
parent fff067b1a6
commit 62481b9f31
7 changed files with 244 additions and 14 deletions

View File

@ -117,12 +117,17 @@ public class WechatController {
* 微信小程序接口能力配置
*/
@GetMapping("/wxapp/config")
@ApiOperation(value = "微信小程序接口能力配置",notes = "微信小程序接口能力配置")
public boolean wxAppConfig(@RequestParam(value = "signature") String signature,
@ApiOperation(value = "微信小程序接口能力配置",notes = "微信小程序接口能力配置",produces = "text/plain;charset=utf-8")
public String wxAppConfig(@RequestParam(value = "signature") String signature,
@RequestParam(value = "timestamp") String timestamp,
@RequestParam(value = "nonce") String nonce) throws WxErrorException {
@RequestParam(value = "nonce") String nonce,
@RequestParam(name = "echostr", required = false) String echostr) throws WxErrorException {
WxMaService wxService = WxMaConfiguration.getWxMaService();
return wxService.checkSignature(timestamp,nonce,signature);
if( wxService.checkSignature(timestamp,nonce,signature)){
return echostr;
}
return "false";
}
/**

View File

@ -75,8 +75,17 @@ logging:
yshop:
#相关配置
version: 3.0
#小程序订阅消息配置
subscribe:
subscribeMaps:
#付款成功
pay_success: W5r2c2kzhbq8uxStkPAVx_sk-5aapMFCqe7b7KU5jXI
#发货成功
delivery-success: 2CB_1UyQrbnlyjJa5syraqJ3cfztPPDOAHe3DEXpMjg
#退款成功
refund_success:
#充值成功
recharge_success:
# 防止XSS攻击
xss:
@ -96,4 +105,4 @@ jwt:
# sm.ms 图床的 token
smms:
token: 1oOP3ykFDI0K6ifmtvU7c8Y1eTWZSlyl
token: 1oOP3ykFDI0K6ifmtvU7c8Y1eTWZSlyl