1.验证当前appid对应参数配置信息
if (!this.wxService.switchover(appid)) {
throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid));
}
2.验证签名
if (!wxService.checkSignature(timestamp, nonce, signature)) {
throw new IllegalArgumentException("非法请求,可能属于伪造的请求!");
}
通过token+timestamp+nonce 进行SHA1加密,与微信signature进行比对。
SHA1.gen(this.getWxMpConfigStorage().getToken(), timestamp, nonce).equals(signature);