1
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"sort"
|
||||
@@ -392,15 +391,23 @@ func (a *API) AccessAPIHavePage(apiStr string, jdParams map[string]interface{},
|
||||
localJdParams[KeyPageNo] = curPage
|
||||
localJdParams[KeyPageSize] = pageSize
|
||||
jsonResult, err := a.AccessAPI(apiStr, localJdParams)
|
||||
globals.SugarLogger.Debugf("============jsonResult====%s", utils.Format4Output(jsonResult, false))
|
||||
globals.SugarLogger.Debugf("============err====%s", err)
|
||||
if err != nil {
|
||||
return nil, totalCount, err
|
||||
}
|
||||
var data map[string]interface{}
|
||||
encryptData, err := JDDecodeToData(a.appSecret, jsonResult["encryptData"].(string))
|
||||
|
||||
if err := utils.UnmarshalUseNumber(encryptData, &data); err != nil {
|
||||
if jsonResult["encryptData"] != nil {
|
||||
encryptData, err := JDDecodeToData(a.appSecret, jsonResult["encryptData"].(string))
|
||||
if err != nil {
|
||||
return nil, totalCount, platformapi.ErrResponseDataFormatWrong
|
||||
}
|
||||
if err := utils.UnmarshalUseNumber(encryptData, &data); err != nil {
|
||||
return nil, totalCount, platformapi.ErrResponseDataFormatWrong
|
||||
}
|
||||
} else if jsonResult["encryptData"] == nil && jsonResult["data"] != nil {
|
||||
if err := utils.UnmarshalUseNumber([]byte(jsonResult["data"].(string)), &data); err != nil {
|
||||
return nil, totalCount, platformapi.ErrResponseDataFormatWrong
|
||||
}
|
||||
} else {
|
||||
return nil, totalCount, platformapi.ErrResponseDataFormatWrong
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user