1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-14 09:42:27 +08:00
This commit is contained in:
yangyl12345
2024-11-25 14:19:01 +00:00
committed by GitHub

View File

@@ -130,7 +130,9 @@ func (ak *StableAccessToken) GetAccessTokenContext(ctx context.Context) (accessT
// 先从cache中取 // 先从cache中取
accessTokenCacheKey := fmt.Sprintf("%s_stable_access_token_%s", ak.cacheKeyPrefix, ak.appID) accessTokenCacheKey := fmt.Sprintf("%s_stable_access_token_%s", ak.cacheKeyPrefix, ak.appID)
if val := ak.cache.Get(accessTokenCacheKey); val != nil { if val := ak.cache.Get(accessTokenCacheKey); val != nil {
return val.(string), nil if accessToken = val.(string); accessToken != "" {
return
}
} }
// cache失效从微信服务器获取 // cache失效从微信服务器获取