File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -87,19 +87,22 @@ type Server struct {
87
87
ExternalTokenHandler func (appId string , appName ... string ) * AccessToken // 通过外部方法统一获取access token ,避免集群情况下token失效
88
88
}
89
89
90
+ func Set (wc * WxConfig ) * Server {
91
+ return & Server {
92
+ AppId : wc .AppId ,
93
+ Secret : wc .Secret ,
94
+ AgentId : wc .AgentId ,
95
+ MchId : wc .MchId ,
96
+ AppName : wc .AppName ,
97
+ AppType : wc .AppType ,
98
+ Token : wc .Token ,
99
+ EncodingAESKey : wc .EncodingAESKey ,
100
+ ExternalTokenHandler : wc .ExternalTokenHandler ,
101
+ }
102
+ }
90
103
// New 微信服务容器
91
104
func New (wc * WxConfig ) * Server {
92
- s := & Server {
93
- AppId : wc .AppId ,
94
- Secret : wc .Secret ,
95
- AgentId : wc .AgentId ,
96
- MchId : wc .MchId ,
97
- AppName : wc .AppName ,
98
- AppType : wc .AppType ,
99
- Token : wc .Token ,
100
- EncodingAESKey : wc .EncodingAESKey ,
101
- ExternalTokenHandler : wc .ExternalTokenHandler ,
102
- }
105
+ s := Set (wc )
103
106
104
107
switch wc .AppType {
105
108
case 1 :
You can’t perform that action at this time.
0 commit comments