对接新供应链-唯品尚

This commit is contained in:
zhongqiang 2025-06-18 10:09:44 +08:00
parent 0b6b76c708
commit 9e328b469b
2 changed files with 7 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"log"
"net/http" "net/http"
"strings" "strings"
) )
@ -268,6 +269,7 @@ func (w *WeiPinShangClient) WPSPost(url string, paramMap map[string]any) (res []
if err != nil { if err != nil {
return return
} }
//req.Proto = "HTTP/2"
req.Header.Set("Content-Type", "application/json") req.Header.Set("Content-Type", "application/json")
req.Header.Set("channelType", w.ChannelType) req.Header.Set("channelType", w.ChannelType)
@ -276,13 +278,15 @@ func (w *WeiPinShangClient) WPSPost(url string, paramMap map[string]any) (res []
return return
} }
req.Header.Set("md5", sign) req.Header.Set("md5", sign)
log.Printf("WPSPost req: %+v\n", req)
// 创建 HTTP 客户端 // 创建 HTTP 客户端
client := &http.Client{} client := &http.Client{}
log.Printf("WPSPost client: %+v\n", client)
// 发送请求 // 发送请求
resp, err := client.Do(req) resp, err := client.Do(req)
log.Printf("WPSPost resp: %+v\n", resp)
if err != nil { if err != nil {
log.Printf("发送请求失败: %+v\n", err)
return return
} }
defer func(Body io.ReadCloser) { defer func(Body io.ReadCloser) {

View File

@ -292,7 +292,7 @@ func TestWeiPinShangClient_GetOrderInfoByThirdNO(t *testing.T) {
Key: "f654ea5bde7635c3f46191191e5c4c8e", Key: "f654ea5bde7635c3f46191191e5c4c8e",
}, },
args: args{ args: args{
orderNo: "570872619444771455", orderNo: "570853643339733632",
}, },
}, },
} }