mxqr

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_CONTENTTYPE_JSON = "application/json;charset=utf-8"

	QRCODE_WXACODE_CREATE_QRCODE_URL = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token="
	QRCODE_WXACODE_GET_URL           = "https://api.weixin.qq.com/wxa/getwxacode?access_token="
	QRCODE_WXACODE_GETUNLIMITED_URL  = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="

	QRCODE_MAX_WIDTH = 1280
)

Variables

View Source
var (
	ERROR_PARAM_EMPTY  = errors.New("请求参数不能为空")
	ERROR_HTTP_REQUEST = errors.New("获取小程序二维码错误")
)

Functions

func CreateQRCode

func CreateQRCode(accessToken, path string, width int, outputFileName, baseURL, basePath string) (imageURL string, err error)

获取小程序二维码,适用于需要的码数量较少的业务场景。 通过该接口生成的小程序码,永久有效,有数量限制 参数:path扫码进入的小程序页面路径,最大长度 128 字节,不能为空;对于小游戏,可以只传入 query 部分,来实现传参效果, 如:传入 "?foo=bar",即可在 wx.getLaunchOptionsSync 接口中的 query 参数获取到 {foo:"bar"}。 width:二维码的宽度,单位 px。最小 280px,最大 1280px

Types

This section is empty.

Jump to

Keyboard shortcuts

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