diff --git a/openplatform/officialaccount/js/js.go b/openplatform/officialaccount/js/js.go index 2dd75a8..160d52f 100644 --- a/openplatform/officialaccount/js/js.go +++ b/openplatform/officialaccount/js/js.go @@ -16,10 +16,10 @@ type Js struct { } //NewJs init -func NewJs(context *context.Context) *Js { +func NewJs(context *context.Context, appID string) *Js { js := new(Js) js.Context = context - jsTicketHandle := credential.NewDefaultJsTicket(context.AppID, credential.CacheKeyOfficialAccountPrefix, context.Cache) + jsTicketHandle := credential.NewDefaultJsTicket(appID, credential.CacheKeyOfficialAccountPrefix, context.Cache) js.SetJsTicketHandle(jsTicketHandle) return js } diff --git a/openplatform/officialaccount/officialaccount.go b/openplatform/officialaccount/officialaccount.go index 882bd88..7729e90 100644 --- a/openplatform/officialaccount/officialaccount.go +++ b/openplatform/officialaccount/officialaccount.go @@ -37,7 +37,7 @@ func (officialAccount *OfficialAccount) PlatformOauth() *oauth.Oauth { // PlatformJs 平台代获取js-sdk配置 func (officialAccount *OfficialAccount) PlatformJs() *js.Js { - return js.NewJs(officialAccount.GetContext()) + return js.NewJs(officialAccount.GetContext(), officialAccount.appID) } //DefaultAuthrAccessToken 默认获取授权ak的方法