最近在做微信公众号,使用的是WxJava工具包,然后按照微信要求进行基本配置以后:
服务器地址URL格式:http://公网可访问域名/wx/portal/{appid}
然后访问后台 WxPortalController 的 authGet 方法进行验证
但是一直验证不通过,报错信息
"base_resp":{"ret":200302,"err_msg":"verify token fail"}
解决办法为将返回的 echostr 字段转成整型
具体代码如下:
@GetMapping(produces = {"text/plain;charset=UTF-8"})
public Long authGet(@PathVariable String appid,
@RequestParam(name = "signature", required = false) String signature,