This commit is contained in:
邹宗楠
2024-04-03 14:49:35 +08:00
parent 3ef2c1ace2
commit e9fd55eaeb

View File

@@ -147,6 +147,7 @@ func RefreshWeixin2Token() (err error) {
}
} else {
tokenInfo := getWX2TokenFromRemote(api.WeixinMiniAPI2.CBGetToken())
globals.SugarLogger.Debugf("=================tokenInfo=1== := %s", utils.Format4Output(tokenInfo, false))
if tokenInfo != nil {
expireTimeStr = utils.Time2Str(time.Now().Add(-weixinTokenExpires))
token = tokenInfo.Token
@@ -375,7 +376,9 @@ func getWXTokenFromRemote(oldToken string) (tokenInfo *syseventhub.TokenInfo) {
}
func getWX2TokenFromRemote(oldToken string) (tokenInfo *syseventhub.TokenInfo) {
globals.SugarLogger.Debugf("=========bool : %s", utils.Format4Output(!globals.IsMainProductEnv() && globals.GetWeixinTokenKey != "" && globals.GetWeixinTokenURL != "", false))
if !globals.IsMainProductEnv() && globals.GetWeixinTokenKey != "" && globals.GetWeixinTokenURL != "" {
globals.SugarLogger.Debugf("=========globals.GetWeixin2TokenURL : %s", utils.Format4Output(globals.GetWeixin2TokenURL, false))
tokenInfo = PollingRemotEvent(globals.GetWeixin2TokenURL, 0, map[string]interface{}{
"oldToken": oldToken,
})