This commit is contained in:
邹宗楠
2025-08-18 18:53:30 +08:00
parent 3f3dc97058
commit d0a669c7a4
3 changed files with 13 additions and 17 deletions

View File

@@ -7,7 +7,6 @@ import (
"encoding/json"
"errors"
"fmt"
"git.rosy.net.cn/jx-callback/globals"
"net/http"
"reflect"
"sort"
@@ -205,12 +204,9 @@ func (a *API) AccessAPI2(apiStr string, jdParams map[string]interface{}, traceIn
var request *http.Request
if userGet {
fullURL := utils.GenerateGetURL(a.baseURL, apiStr, params)
// baseapi.SugarLogger.Debug(fullURL)
request, _ = http.NewRequest(http.MethodGet, fullURL, nil)
} else {
fullURL := utils.GenerateGetURL(a.baseURL, apiStr, nil)
// baseapi.SugarLogger.Debug(utils.Map2URLValues(params).Encode())
globals.SugarLogger.Debugf("-----paramsparams- :%s", utils.Format4Output(params, false))
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")

View File

@@ -51,19 +51,18 @@ func TestGetStoreInfoByStationNo(t *testing.T) {
func TestUpdateStoreInfo4Open(t *testing.T) {
params := &OpStoreParams{
StationNo: "12664100",
StationName: "旺佳超市",
OutSystemID: "668836",
Mobile: "17751816719",
Phone: "17751816719",
Lat: 43.622098,
Lng: 122.275918,
City: 902,
County: 32769,
StationAddress: "内蒙古自治区通辽市科尔沁区百花新城",
Operator: "18981810340",
ServiceTimeEnd1: 44,
ServiceTimeStart1: 14,
StationNo: "11890095",
OutSystemID: "100654",
Mobile: "18123353875",
Phone: "18123353875",
Lat: 30.745945,
Lng: 103.987782,
City: 1930,
County: 49322,
StationAddress: "郫都区成都市郫都区犀浦镇华都大道东一段330号1层连心菜市场34号",
Operator: "jxadmin-18981810340",
ServiceTimeEnd1: 38,
ServiceTimeStart1: 16,
CoordinateType: 3,
CloseStatus: 0,
}

View File

@@ -21,6 +21,7 @@ func (a *API) EventSignChange(c *http.Request) (*CallbackResponse, []byte) {
if beego.BConfig.RunMode == "jxgy" || beego.BConfig.RunMode == "jxpet" {
return CallbackResponseErr(true), body
}
return &CallbackResponse{Code: CallbackSuccessCode, Msg: CallbackSuccess}, body
signParam := a.appKey + string(body) + a.appSecret
sign := fmt.Sprintf("%X", md5.Sum([]byte(signParam)))
return CallbackResponseErr(sign != c.Header.Get("event-sign")), body