aa
This commit is contained in:
16
platformapi/qywxapi/cgibin.go
Normal file
16
platformapi/qywxapi/cgibin.go
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user