From 9cecda04697f0e92602d9cf9efb9b4afd3d47b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=84=8F=E7=90=A6=E8=A1=8C?= <31980412+lixd@users.noreply.github.com> Date: Tue, 7 Dec 2021 19:05:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=A0=81=E3=80=81UR?= =?UTF-8?q?L=20Link=20=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0(#502,#512)=20(#?= =?UTF-8?q?514)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 小程序码、URL Link 增加参数(#502,#512) * gofmt --- miniprogram/qrcode/qrcode.go | 4 ++++ miniprogram/urllink/urllink.go | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/miniprogram/qrcode/qrcode.go b/miniprogram/qrcode/qrcode.go index 3ee3179..5420088 100644 --- a/miniprogram/qrcode/qrcode.go +++ b/miniprogram/qrcode/qrcode.go @@ -40,6 +40,8 @@ type QRCoder struct { Page string `json:"page,omitempty"` // path 扫码进入的小程序页面路径 Path string `json:"path,omitempty"` + // checkPath 检查page 是否存在,为 true 时 page 必须是已经发布的小程序存在的页面(否则报错);为 false 时允许小程序未发布或者 page 不存在, 但page 有数量上限(60000个)请勿滥用 + CheckPath bool `json:"check_path,omitempty"` // width 图片宽度 Width int `json:"width,omitempty"` // scene 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~,其它字符请自行编码为合法字符(因不支持%,中文无法使用 urlencode 处理,请使用其他编码方式) @@ -50,6 +52,8 @@ type QRCoder struct { LineColor Color `json:"line_color,omitempty"` // isHyaline 是否需要透明底色 IsHyaline bool `json:"is_hyaline,omitempty"` + // envVersion 要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop" + EnvVersion string `json:"env_version,omitempty"` } // fetchCode 请求并返回二维码二进制数据 diff --git a/miniprogram/urllink/urllink.go b/miniprogram/urllink/urllink.go index c89aa7e..378d58a 100644 --- a/miniprogram/urllink/urllink.go +++ b/miniprogram/urllink/urllink.go @@ -33,8 +33,10 @@ const ( // ULParams 请求参数 // https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/url-link/urllink.generate.html#请求参数 type ULParams struct { - Path string `json:"path"` - Query string `json:"query"` + Path string `json:"path"` + Query string `json:"query"` + // envVersion 要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop" + EnvVersion string `json:"env_version,omitempty"` IsExpire bool `json:"is_expire"` ExpireType TExpireType `json:"expire_type"` ExpireTime int64 `json:"expire_time"`