|
@@ -20,8 +20,8 @@ import (
|
20
|
20
|
"gitee.com/yansen_zh/wxcomponent/utils/request"
|
21
|
21
|
)
|
22
|
22
|
|
23
|
|
-// BindComponentParam 构建授权链接入参
|
24
|
|
-type BindComponentParam struct {
|
|
23
|
+// AuthLinkParam 构建授权链接入参
|
|
24
|
+type AuthLinkParam struct {
|
25
|
25
|
ComponentAppId string
|
26
|
26
|
PreAuthCode string
|
27
|
27
|
|
|
@@ -36,18 +36,18 @@ const (
|
36
|
36
|
bindcomponent = "https://mp.weixin.qq.com/safe/bindcomponent"
|
37
|
37
|
)
|
38
|
38
|
|
39
|
|
-// BindComponentByPC 构建PC端授权链接
|
40
|
|
-func BindComponentByPC(param BindComponentParam) (*url.URL, error) {
|
41
|
|
- return BindComponent("PC", param)
|
|
39
|
+// GetPCAuthLink 构建PC端授权链接
|
|
40
|
+func GetPCAuthLink(param AuthLinkParam) (*url.URL, error) {
|
|
41
|
+ return GetAuthLink("PC", param)
|
42
|
42
|
}
|
43
|
43
|
|
44
|
|
-// BindComponentByH5 构建H5端授权链接
|
45
|
|
-func BindComponentByH5(param BindComponentParam) (*url.URL, error) {
|
46
|
|
- return BindComponent("H5", param)
|
|
44
|
+// GetH5AuthLink 构建H5端授权链接
|
|
45
|
+func GetH5AuthLink(param AuthLinkParam) (*url.URL, error) {
|
|
46
|
+ return GetAuthLink("H5", param)
|
47
|
47
|
}
|
48
|
48
|
|
49
|
|
-// BindComponent 构建授权链接
|
50
|
|
-func BindComponent(client string, param BindComponentParam) (*url.URL, error) {
|
|
49
|
+// GetAuthLink 构建授权链接
|
|
50
|
+func GetAuthLink(client string, param AuthLinkParam) (*url.URL, error) {
|
51
|
51
|
isH5 := client == "H5"
|
52
|
52
|
|
53
|
53
|
if param.ComponentAppId == "" {
|