mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-11 16:22:26 +08:00
Update default_access_token.go
微信获取稳定版token,只有不等于空字符串的情况下才会返回access_token信息,未空的情况,继续调去微信服务
This commit is contained in:
@@ -130,7 +130,9 @@ func (ak *StableAccessToken) GetAccessTokenContext(ctx context.Context) (accessT
|
||||
// 先从cache中取
|
||||
accessTokenCacheKey := fmt.Sprintf("%s_stable_access_token_%s", ak.cacheKeyPrefix, ak.appID)
|
||||
if val := ak.cache.Get(accessTokenCacheKey); val != nil {
|
||||
return val.(string), nil
|
||||
if accessToken = val.(string); accessToken != "" {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// cache失效,从微信服务器获取
|
||||
|
||||
Reference in New Issue
Block a user