|
@@ -0,0 +1,17 @@
|
|
1
|
+package wxcomponent
|
|
2
|
+
|
|
3
|
+import (
|
|
4
|
+ "gitee.com/yansen_zh/wxcomponent/api/mp/webpage"
|
|
5
|
+ "gitee.com/yansen_zh/wxcomponent/config"
|
|
6
|
+)
|
|
7
|
+
|
|
8
|
+// JsapiTicket 代公众号使用js sdk
|
|
9
|
+func JsapiTicket(appID, url string) (*webpage.JsapiSignature, error) {
|
|
10
|
+ ticket, err := webpage.GetJSTicket(config.GetAuthorizer().GetAccessToken(appID))
|
|
11
|
+ if err != nil {
|
|
12
|
+ return nil, err
|
|
13
|
+ }
|
|
14
|
+
|
|
15
|
+ signature := webpage.GetJSAPISignature(ticket.Ticket, url)
|
|
16
|
+ return signature, nil
|
|
17
|
+}
|