12345678910111213141516171819202122232425262728293031323334353637 |
- package mp
-
- import (
- "net/url"
- "strings"
-
- wxerr "gitee.com/yansen_zh/wxcomponent/errors"
- )
-
-
- type MpWebAccessTokenResult struct {
- wxerr.Error
-
- AccessToken string `json:"access_token"`
-
- ExpiresIn int `json:"expires_in"`
-
- RefreshToken string `json:"refresh_token"`
-
- OpenID string `json:"openid"`
-
- Scope string `json:"scope"`
- }
-
-
-
- func GetAuthorizationCodeLink(componentAppID, appID, redirectURI, state string, scopes ...string) string {
- params := url.Values{}
- params.Set("appid", appID)
- params.Set("redirect_uri", redirectURI)
- params.Set("response_type", "code")
- params.Set("scope", strings.Join(scopes, ","))
- params.Set("state", state)
- params.Set("component_appid", componentAppID)
-
- return "https://open.weixin.qq.com/connect/oauth2/authorize?" + params.Encode()
- }
|