Documentation ¶
Overview ¶
Package user 用户
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSessionKey ¶
func CheckSessionKey(ctx *miniprogram.Miniprogram, params url.Values) (resp []byte, err error)
校验服务器所保存的登录态 session_key 是否合法。为了保持 session_key 私密性,接口不明文传输 session_key,而是通过校验登录态签名完成。
See: https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/login/auth.checkSessionKey.html
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/miniprogram" "github.com/fastwego/miniprogram/minigame/apis/user" ) func main() { var ctx *miniprogram.Miniprogram params := url.Values{} resp, err := user.CheckSessionKey(ctx, params) fmt.Println(resp, err) }
Output:
func Code2Session ¶
func Code2Session(ctx *miniprogram.Miniprogram, params url.Values) (resp []byte, err error)
登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程。更多使用方法详见 小程序登录。
See: https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/login/auth.code2Session.html
Example ¶
package main import ( "fmt" "net/url" "github.com/fastwego/miniprogram" "github.com/fastwego/miniprogram/minigame/apis/user" ) func main() { var ctx *miniprogram.Miniprogram params := url.Values{} resp, err := user.Code2Session(ctx, params) fmt.Println(resp, err) }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.