Documentation ¶
Overview ¶
*
- 网站应用 * *第一步:请求CODE
- 第三方使用网站应用授权登录前请注意已获取相应网页授权作用域(scope=snsapi_login),则可以通过在PC端打开以下链接:
- https://open.weixin.qq.com/connect/qrconnect?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect *
- https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Authorized_Interface_Calling_UnionID.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAccessToken ¶
GetAccessToken 官司说明 https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140842 微信网页通过code 授权access_token, 这个授权只是某一个具体的app,某个具体openid对应的access_token
func RefreshToken ¶
RefreshToken 刷新access_token https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=AppID&grant_type=refresh_token&refresh_token=REFRESH_TOKEN
Types ¶
type User ¶
type User struct { OpenId string `json:"openid"` UnionId string `json:"unionid,omitempty"` //开发者最好保存用户unionID信息,以便以后在不同应用中进行用户信息互通。 Nick string `json:"nickname,omitempty"` Sex int8 `json:"sex,omitempty"` ImgUrl string `json:"headimgurl,omitempty"` Province string `json:"province,omitempty"` City string `json:"city,omitempty"` Country string `json:"country,omitempty"` Privilege []string `json:"privilege,omitempty"` Language string `json:"language,omitempty"` AppId string `json:"appid"` }
type UserEx ¶
type UserEx struct { User Subscribe int `json:"subscribe"` SubscribeTime int64 `json:"subscribe_time,omitempty"` Remark string `json:"remark,omitempty"` GroupId int64 `json:"groupid,omitempty"` TagIds []int64 `json:"tagid_list,omitempty"` SubscribeScene string `json:"subscribe_scene,omitempty"` QRSceneId int32 `json:"qr_scene,omitempty"` QRSceneStr string `json:"qr_scene_str,omitempty"` }
Click to show internal directories.
Click to hide internal directories.