This commit is contained in:
yangduo 2025-01-02 10:22:30 +08:00
parent a5a4645ff2
commit 6f039a0d8d

View File

@ -394,7 +394,7 @@ func (wp *wxpay) checkAccessToken() {
if f5.IsOnlineEnv() { if f5.IsOnlineEnv() {
wp.gamesGoods.Range(func(gameid int64, value map[int64]int64) bool { wp.gamesGoods.Range(func(gameid int64, value map[int64]int64) bool {
cfg, _ := wp.accessTokens.Load(gameid) cfg, _ := wp.accessTokens.Load(gameid)
if wp.refreshflag || (cfg != nil && cfg.Expire < f5.GetApp().GetRealSeconds()) { if wp.refreshflag || (cfg != nil && cfg.Expire <= f5.GetApp().GetRealSeconds()) {
wp.freshAccessToken(gameid) wp.freshAccessToken(gameid)
} }
return true return true
@ -402,7 +402,7 @@ func (wp *wxpay) checkAccessToken() {
} else { } else {
if !wp.refreshflag { if !wp.refreshflag {
wp.accessTokens.Range(func(key int64, value TokenInfo) bool { wp.accessTokens.Range(func(key int64, value TokenInfo) bool {
if value.Expire < f5.GetApp().GetRealSeconds() { if value.Expire <= f5.GetApp().GetRealSeconds() {
wp.refreshflag = true wp.refreshflag = true
return false return false
} }