微信请求 header 添加 Wechatpay-Serial
This commit is contained in:
@@ -54,12 +54,14 @@ public class WechatReqUtils {
|
|||||||
HttpRequest request = switch (method) {
|
HttpRequest request = switch (method) {
|
||||||
case "POST" -> HttpUtil.createPost(configDto.getDomain() + url)
|
case "POST" -> HttpUtil.createPost(configDto.getDomain() + url)
|
||||||
.header("Authorization", authorization)
|
.header("Authorization", authorization)
|
||||||
|
.header("Wechatpay-Serial", configDto.getPublicKeyId())
|
||||||
.charset(StandardCharsets.UTF_8)
|
.charset(StandardCharsets.UTF_8)
|
||||||
.contentType("application/json")
|
.contentType("application/json")
|
||||||
.body(body );
|
.body(body );
|
||||||
|
|
||||||
case "GET" -> HttpUtil.createGet(configDto.getDomain() + url)
|
case "GET" -> HttpUtil.createGet(configDto.getDomain() + url)
|
||||||
.header("Authorization", authorization)
|
.header("Authorization", authorization)
|
||||||
|
.header("Wechatpay-Serial", configDto.getPublicKeyId())
|
||||||
.charset(StandardCharsets.UTF_8)
|
.charset(StandardCharsets.UTF_8)
|
||||||
.contentType("application/json");
|
.contentType("application/json");
|
||||||
default -> throw new CzgException("不支持的请求方法");
|
default -> throw new CzgException("不支持的请求方法");
|
||||||
|
|||||||
Reference in New Issue
Block a user