Files
baseapi/platformapi/qywxapi/cgibin.go
suyl 3c3931e811 aa
2021-05-25 14:46:45 +08:00

17 lines
413 B
Go

package qywxapi
import "encoding/json"
func (a *API) GetProviderToken() (token string, err error) {
params := map[string]interface{}{
"corpid": a.appID,
"provider_secret": a.secret,
}
str, _ := json.Marshal(params)
result, err := a.AccessAPI(tokenURL, string(str), true)
if result["provider_access_token"] != "" {
return result["provider_access_token"].(string), err
}
return token, err
}