🎨 避免对曾变化的guava方法的依赖,以免对使用不同版本guava的用户造成困惑

This commit is contained in:
Binary Wang
2022-07-24 21:59:47 +08:00
parent 7cd213da65
commit 0cfcc8d4a0
8 changed files with 28 additions and 19 deletions

View File

@ -5,6 +5,7 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import me.chanjar.weixin.common.error.WxRuntimeException;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
@ -65,7 +66,7 @@ public class WxCryptUtil {
public WxCryptUtil(String token, String encodingAesKey, String appidOrCorpid) {
this.token = token;
this.appidOrCorpid = appidOrCorpid;
this.aesKey = Base64.decodeBase64(CharMatcher.whitespace().removeFrom(encodingAesKey));
this.aesKey = Base64.decodeBase64(StringUtils.remove(encodingAesKey, " "));
}
private static String extractEncryptPart(String xml) {