Skip to content

Commit

Permalink
minip qrcode增加EnvVersion参数并升级版本依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
liniu committed May 3, 2024
1 parent dd02e55 commit a22714b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.17
require (
github.com/golang/mock v1.6.0
github.com/stretchr/testify v1.8.4
github.com/tidwall/gjson v1.17.0
golang.org/x/crypto v0.17.0
github.com/tidwall/gjson v1.17.1
golang.org/x/crypto v0.22.0
)

require (
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM=
github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U=
github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
Expand All @@ -37,6 +39,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
Expand Down
11 changes: 6 additions & 5 deletions minip/qrcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ type RGB struct {
}

type ParamsQRCodeGet struct {
Path string `json:"path"` // 扫码进入的小程序页面路径,最大长度 128 字节,不能为空;对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar",即可在 wx.getLaunchOptionsSync 接口中的 query 参数获取到 {foo:"bar"}。
Width int `json:"width,omitempty"` // 二维码的宽度,单位 px。最小 280px,最大 1280px
AutoColor bool `json:"auto_color,omitempty"` // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调
LineColor *RGB `json:"line_color,omitempty"` // auto_color 为 false 时生效,使用 rgb 设置颜色,十进制表示,默认:{"r":0,"g":0,"b":0}
IsHyaline bool `json:"is_hyaline,omitempty"` // 是否需要透明底色,为 true 时,生成透明底色的小程序码
Path string `json:"path"` // 扫码进入的小程序页面路径,最大长度 128 字节,不能为空;对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar",即可在 wx.getLaunchOptionsSync 接口中的 query 参数获取到 {foo:"bar"}。
Width int `json:"width,omitempty"` // 二维码的宽度,单位 px。最小 280px,最大 1280px
AutoColor bool `json:"auto_color,omitempty"` // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调
LineColor *RGB `json:"line_color,omitempty"` // auto_color 为 false 时生效,使用 rgb 设置颜色,十进制表示,默认:{"r":0,"g":0,"b":0}
IsHyaline bool `json:"is_hyaline,omitempty"` // 是否需要透明底色,为 true 时,生成透明底色的小程序码
EnvVersion EnvVersion `json:"env_version,omitempty"` // 要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop",默认开发版
}

// GetQRCode 获取小程序二维码(数量有限)
Expand Down

0 comments on commit a22714b

Please sign in to comment.