- dingding.GetJSAPITicket
This commit is contained in:
@@ -158,3 +158,16 @@ func (a *API) AccessAPI(action string, params map[string]interface{}, bodyMap ma
|
||||
})
|
||||
return retVal, err
|
||||
}
|
||||
|
||||
func (a *API) GetJSAPITicket(getType string) (expiresIn int, ticket string, err error) {
|
||||
if getType == "" {
|
||||
getType = "jsapi"
|
||||
}
|
||||
result, err := a.AccessAPI("get_jsapi_ticket", map[string]interface{}{
|
||||
"type": getType,
|
||||
}, nil)
|
||||
if err != nil {
|
||||
return 0, "", err
|
||||
}
|
||||
return int(utils.MustInterface2Int64(result["expires_in"])), utils.Interface2String(result["ticket"]), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user