This commit is contained in:
gazebo
2019-12-09 10:38:50 +08:00
parent ac9a98c6b9
commit 992711c5c2
2 changed files with 35 additions and 19 deletions

View File

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