mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-25 01:14:36 +08:00
检查签名时,如果有异常打印出日志
This commit is contained in:
parent
787a4ccaad
commit
9c0e9e44fb
@ -63,6 +63,7 @@ public abstract class AbstractWxCpServiceImpl<H, P> implements WxCpService, Requ
|
|||||||
return SHA1.gen(this.configStorage.getToken(), timestamp, nonce, data)
|
return SHA1.gen(this.configStorage.getToken(), timestamp, nonce, data)
|
||||||
.equals(msgSignature);
|
.equals(msgSignature);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
this.log.error("Checking signature failed, and the reason is :" + e.getMessage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -293,7 +294,7 @@ public abstract class AbstractWxCpServiceImpl<H, P> implements WxCpService, Requ
|
|||||||
String responseContent = get(url, params);
|
String responseContent = get(url, params);
|
||||||
JsonElement tmpJsonElement = new JsonParser().parse(responseContent);
|
JsonElement tmpJsonElement = new JsonParser().parse(responseContent);
|
||||||
return WxCpGsonBuilder.INSTANCE.create()
|
return WxCpGsonBuilder.INSTANCE.create()
|
||||||
.fromJson( tmpJsonElement.getAsJsonObject().get("userlist"),
|
.fromJson(tmpJsonElement.getAsJsonObject().get("userlist"),
|
||||||
new TypeToken<List<WxCpUser>>() {
|
new TypeToken<List<WxCpUser>>() {
|
||||||
}.getType()
|
}.getType()
|
||||||
);
|
);
|
||||||
|
@ -53,6 +53,7 @@ public abstract class AbstractWxMpServiceImpl<H, P> implements WxMpService, Requ
|
|||||||
return SHA1.gen(this.getWxMpConfigStorage().getToken(), timestamp, nonce)
|
return SHA1.gen(this.getWxMpConfigStorage().getToken(), timestamp, nonce)
|
||||||
.equals(signature);
|
.equals(signature);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
this.log.error("Checking signature failed, and the reason is :" + e.getMessage());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user