This commit is contained in:
richboo111
2022-11-02 10:17:59 +08:00
parent 4a4aacd209
commit 35c2e385bd
2 changed files with 2 additions and 2 deletions

View File

@@ -268,7 +268,7 @@ func (a *API) GetStoreFreight(storeId int64) ([]int64, error) {
return nil, errors.New(result.SubMsg)
}
tempList := make([]int64, 0)
if len(result.Data.StoreFreights) == 0 {
if utils.IsNil(result.Data) {
tempList = append(tempList, 0)
return tempList, err
} else {

View File

@@ -257,7 +257,7 @@ func TestUpdateStore(t *testing.T) {
func TestGetStoreBindFreight(t *testing.T) {
var token = `{"access_token":"d590b649-0dd9-4988-a5e2-bf7e06e2f105","expires_in":1667808519,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"f57c6a55-af5f-45ca-8ade-b2282be86341","authority_id":""}`
var a2 = New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
resp, err := a2.GetStoreFreight(62490423)
resp, err := a2.GetStoreFreight(64251634)
fmt.Println(resp)
fmt.Println(err)
}