-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用spring的RestTemplate配置,签名会失败 #42
Comments
EntityUtils.toString(entity)会使用entity中设置的字符集的。直接给entity设置成utf-8字符集就好了,而且微信支付只支持utf-8。 |
RestTemplate,默认是不会在entity写入字符集信息的,现在目前做法,就是我把该项目原来整个复制下来,EntityUtils.toString强制使用UTF-8字符集转换 |
这个问题理论上应该是在RestTemplate侧解决的,你 @mmzhi 看看stackoverflow上的建议行不行?
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
具体原因是WechatPay2Credentials类中的buildMessage方法,EntityUtils.toString会将utf-8默认转换成GBK,再拼接签名,就会导致签名不一致
The text was updated successfully, but these errors were encountered: