refactor: code-optimization (#1885)

* refactor: code-optimization

* fix: restoring code style

* fix: gofmt
This commit is contained in:
guangwu
2023-05-23 17:54:51 +08:00
committed by GitHub
parent 2389d47c34
commit 54e4747dbc
12 changed files with 22 additions and 29 deletions

View File

@ -75,7 +75,9 @@ func (idp *WeComIdProvider) GetToken(code string) (*oauth2.Token, error) {
ProviderSecret string `json:"provider_secret"`
}{idp.Config.ClientID, idp.Config.ClientSecret}
data, err := idp.postWithBody(pTokenParams, "https://qyapi.weixin.qq.com/cgi-bin/service/get_provider_token")
if err != nil {
return nil, err
}
pToken := &WeComProviderToken{}
err = json.Unmarshal(data, pToken)
if err != nil {