mini

package
v1.8.101 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Zlib Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QrcCreate

func QrcCreate(api *token.Api, qrc *WxaQrcReq) ([]byte, error)

获取小程序码,适用于需要的码数量极多的业务场景。通过该接口生成的小程序码,永久有效,数量暂无限制 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/qr-code/wxacode.getUnlimited.html

Types

type Phone

type Phone struct {
	User

	//用户绑定的手机号(国外手机号会有区号)
	PhoneNumber string `json:"phoneNumber,omitempty"`

	//没有区号的手机号
	PurePhoneNumber string `json:"purePhoneNumber,omitempty"`

	//区号
	CountryCode string `json:"countryCode,omitempty"`
}

func GetPhone

func GetPhone(encryptData, sessionKey, ivStr string) (*Phone, error)

func (*Phone) DataType

func (p *Phone) DataType() string

implement common.data.Base interface

type SessionKey

type SessionKey struct {
	SessionKey string `json:"session_key,omitempty"`
	OpenId     string `json:"openid,omitempty"`  //每个应用有对应的openid
	UnionId    string `json:"unionid,omitempty"` //开发者最好保存用户unionID信息,以便以后在不同应用中进行用户信息互通。
	AppId      string `json:"-"`
}

func GetCode2Session

func GetCode2Session(appId string, secret string, code string) (*SessionKey, error)

登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程。更多使用方法详见 小程序登录。 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html

type User

type User struct {
	OpenId    string   `json:"openId"`
	UnionId   string   `json:"unionId,omitempty"` //开发者最好保存用户unionID信息,以便以后在不同应用中进行用户信息互通。
	Nick      string   `json:"nickName,omitempty"`
	Gender    int8     `json:"gender,omitempty"`
	AvatarUrl string   `json:"avatarUrl,omitempty"`
	Province  string   `json:"province,omitempty"`
	City      string   `json:"city,omitempty"`
	Country   string   `json:"country,omitempty"`
	Language  string   `json:"language,omitempty"`
	Privilege []string `json:"privilege,omitempty"`
	AppId     string   `json:"-"`
}

func GetUser

func GetUser(encryptData, sessionKey, ivStr string) (*User, error)

func (*User) DataType

func (u *User) DataType() string

implement common.data.Base interface

type WxaQrcReq

type WxaQrcReq struct {
	Scene string `json:"scene"`
	Page  string `json:"page,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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