wxminipro

package
v0.0.0-...-62252a8 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: MulanPSL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesCBCDncrypt

func AesCBCDncrypt(encryptData, key, iv []byte) ([]byte, error)

解密

func CheckUserInfoSignature

func CheckUserInfoSignature(sessionKey, rawData, signature string) bool

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

去除填充

Types

type LoginResult

type LoginResult struct {
	Openid     string          `json:"openid"`
	SessionKey string          `json:"session_key"`
	Unionid    string          `json:"unionid"`
	Errcode    LoginResultCode `json:"errcode"`
	Errmsg     string          `json:"errmsg"`
}

func Login

func Login(code string) (result *LoginResult, err error)

type LoginResultCode

type LoginResultCode int
const (
	LoginResultCodeBusy    LoginResultCode = -1    // 系统繁忙,此时请开发者稍候再试
	LoginResultCodeSuccess LoginResultCode = 0     // 请求成功
	LoginResultCodeInValid LoginResultCode = 40029 // code 无效
	LoginResultCodeLimit   LoginResultCode = 45011 //  频率限制,每个用户每分钟100次
)

type WxMaUserInfo

type WxMaUserInfo struct {
	OpenId    string `json:"openId"`
	NickName  string `json:"nickName"`
	Gender    int8   `json:"gender"`
	Language  string `json:"language"`
	City      string `json:"city"`
	Province  string `json:"province"`
	Country   string `json:"country"`
	AvatarUrl string `json:"avatarUrl"`
	UnionId   string `json:"unionId"`
}

func GetUserInfo

func GetUserInfo(sessionKey, encryptedData, ivStr string) (userInfo *WxMaUserInfo, err error)

Jump to

Keyboard shortcuts

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