京东回调api切换至新接口

This commit is contained in:
gazebo
2019-12-09 09:38:53 +08:00
parent 441fa5e3d8
commit 0587e883e0
2 changed files with 19 additions and 46 deletions

View File

@@ -26,14 +26,14 @@ func getAPI(appOrgCode string) (apiObj *jdapi.API) {
return partner.CurAPIManager.GetAPI(model.VendorIDJD, appOrgCode).(*jdapi.API)
}
func GetAPIByToken(token string) (apiObj *jdapi.API) {
if token == "" {
func GetAPIByAppKey(appKey string) (apiObj *jdapi.API) {
if appKey == "" {
apiObj = getAPI("")
} else {
apiList := partner.CurAPIManager.GetAppOrgCodeList(model.VendorIDJD)
for _, v := range apiList {
jdAPI := partner.CurAPIManager.GetAPI(model.VendorIDJD, v).(*jdapi.API)
if jdAPI.GetToken() == token {
if jdAPI.GetAppKey() == appKey {
apiObj = jdAPI
break
}