mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-04 12:52:27 +08:00
避免无效的access_token留在cache (#645)
This commit is contained in:
@@ -193,7 +193,7 @@ func (ctx *Context) RefreshAuthrToken(appid, refreshToken string) (*AuthrAccessT
|
||||
}
|
||||
|
||||
authrTokenKey := "authorizer_access_token_" + appid
|
||||
if err := ctx.Cache.Set(authrTokenKey, ret.AccessToken, time.Minute*80); err != nil {
|
||||
if err := ctx.Cache.Set(authrTokenKey, ret.AccessToken, time.Second*time.Duration(ret.ExpiresIn-30)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ret, nil
|
||||
|
||||
Reference in New Issue
Block a user