mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-10-29 01:18:36 +08:00 
			
		
		
		
	🎨 #1610 换用guava的相应方法实现base64解码,避免因commons-codec版本问题导致解码异常
This commit is contained in:
		| @ -12,6 +12,8 @@ import javax.xml.parsers.DocumentBuilder; | ||||
| import javax.xml.parsers.DocumentBuilderFactory; | ||||
| import javax.xml.parsers.ParserConfigurationException; | ||||
|  | ||||
| import com.google.common.base.CharMatcher; | ||||
| import com.google.common.io.BaseEncoding; | ||||
| import org.apache.commons.codec.binary.Base64; | ||||
| import org.w3c.dom.Document; | ||||
| import org.w3c.dom.Element; | ||||
| @ -64,7 +66,7 @@ public class WxCryptUtil { | ||||
|   public WxCryptUtil(String token, String encodingAesKey, String appidOrCorpid) { | ||||
|     this.token = token; | ||||
|     this.appidOrCorpid = appidOrCorpid; | ||||
|     this.aesKey = Base64.decodeBase64(encodingAesKey + "="); | ||||
|     this.aesKey = BaseEncoding.base64().decode(CharMatcher.whitespace().removeFrom(encodingAesKey)); | ||||
|   } | ||||
|  | ||||
|   private static String extractEncryptPart(String xml) { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Binary Wang
					Binary Wang