!261 修复 API接口签名校验参数接口NPE问题,增加必须参数的非空校验处理。

Merge pull request !261 from KonBAI/dev
This commit is contained in:
孔明 2023-07-27 17:17:24 +00:00 committed by Gitee
commit 62f92e9097
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -315,6 +315,11 @@ public class SaSignTemplate {
String nonceValue = paramMap.get(nonce);
String signValue = paramMap.get(sign);
// 三个参数必须全部非空
SaSignException.throwByNull(timestampValue, "缺少 timestamp 字段");
SaSignException.throwByNull(nonceValue, "缺少 nonce 字段");
SaSignException.throwByNull(signValue, "缺少 sign 字段");
// 依次校验三个参数
checkTimestamp(Long.parseLong(timestampValue));
if(getSignConfigOrGlobal().getIsCheckNonce()) {