Skip to content

Commit 975cfda

Browse files
committed
生成sha1签名时,加入参数判断
1 parent 0fe431f commit 975cfda

File tree

1 file changed

+4
-0
lines changed
  • weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto

1 file changed

+4
-0
lines changed

weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/SHA1.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ public static String gen(String... arr) {
3030
* 用&串接arr参数,生成sha1 digest
3131
*/
3232
public static String genWithAmple(String... arr) {
33+
if (StringUtils.isAnyEmpty(arr)) {
34+
throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr));
35+
}
36+
3337
Arrays.sort(arr);
3438
StringBuilder sb = new StringBuilder();
3539
for (int i = 0; i < arr.length; i++) {

0 commit comments

Comments
 (0)