mirror of
https://github.com/silenceper/wechat.git
synced 2026-11-16 05:12:03 +08:00
实现access_token获取
This commit is contained in:
1 parent
33f2b2ef60
commit
d9075933c1
7 files changed
+195
-4
No files matched your search
@@ -2,7 +2,9 @@ package wechat
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"sync"
|
||||
|
||||
"github.com/silenceper/wechat/cache"
|
||||
"github.com/silenceper/wechat/context"
|
||||
"github.com/silenceper/wechat/server"
|
||||
)
|
||||
@@ -18,6 +20,7 @@ type Config struct {
|
||||
AppSecret string
|
||||
Token string
|
||||
EncodingAESKey string
|
||||
Cache cache.Cache
|
||||
}
|
||||
|
||||
//NewWechat init
|
||||
@@ -32,6 +35,8 @@ func copyConfigToContext(cfg *Config, context *context.Context) {
|
||||
context.AppSecret = cfg.AppSecret
|
||||
context.Token = cfg.Token
|
||||
context.EncodingAESKey = cfg.EncodingAESKey
|
||||
context.Cache = cfg.Cache
|
||||
context.SetAccessTokenLock(new(sync.RWMutex))
|
||||
}
|
||||
|
||||
//GetServer init
|
||||
|
||||
Reference in new issue
Block a user