This commit is contained in:
邹宗楠
2024-01-10 09:27:26 +08:00
parent 58248e4ccb
commit 005bd0de6c
4 changed files with 45 additions and 14 deletions

View File

@@ -12,8 +12,9 @@ import (
)
const (
prodURL = "http://api.jxc4.com/openapi/CallOpenAPI"
signKey = "sign"
prodURL = "http://api.jxc4.com/openapi/CallOpenAPI" // 老版本的URL
prodURLNew = "http://print.jxcs.net/v2/openapi/CallOpenAPI" // 老版本的URL
signKey = "sign"
)
const (
// ResponseCodeSuccess 操作成功
@@ -76,7 +77,7 @@ func (a *API) AccessAPI(apiName string, apiParams map[string]interface{}) (retVa
params["timestamp"] = utils.Int64ToStr(time.Now().Unix())
sign := a.signParams(params)
params[signKey] = sign
fullURL := prodURL
fullURL := prodURLNew
request, _ := http.NewRequest(http.MethodPost, fullURL, strings.NewReader(utils.Map2URLValues(params).Encode()))
request.Header.Set("charset", "UTF-8")
request.Header.Set("Content-Type", "application/x-www-form-urlencoded")

File diff suppressed because one or more lines are too long