Merge remote-tracking branch 'origin/mark' into yonghui
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user