wxmini

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOpenId

func GetOpenId(wxAppId, wxAppSecret, code string) (openId string, err error)

func GetUnionId

func GetUnionId(appId, appSecret, code string) (unionId string, err error)

Types

type LoginReply

type LoginReply struct {
	UInfo   *UserInfo
	Session *UserSession
}

func Login

func Login(wxAppId, wxAppSecret, code, rawData, signature string) (*LoginReply, error)

type UserInfo

type UserInfo struct {
	NickName  string `json:"nickName"`  // 昵称
	Gender    int    `json:"gender"`    // 性别
	Language  string `json:"language"`  // 语言
	City      string `json:"city"`      // 城市
	Province  string `json:"province"`  // 省份
	Country   string `json:"country"`   // 国家
	AvatarUrl string `json:"avatarUrl"` // 头像链接
}

func (*UserInfo) Region

func (u *UserInfo) Region() string

type UserSession

type UserSession struct {
	OpenId     string `json:"openid"`      // 用户唯一标识
	SessionKey string `json:"session_key"` // 会话密钥
	UnionId    string `json:"unionid"`     // 用户在开放平台的唯一标识符,在满足 UnionID 下发条件的情况下会返回,详见 UnionID 机制说明。
	Errcode    int    `json:"errcode"`     // 错误码
	Errmsg     string `json:"errmsg"`      // 错误信息
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL