diff --git a/business/jxutils/eventhub/syseventhub/syseventhub.go b/business/jxutils/eventhub/syseventhub/syseventhub.go index a1869442b..389153ffb 100644 --- a/business/jxutils/eventhub/syseventhub/syseventhub.go +++ b/business/jxutils/eventhub/syseventhub/syseventhub.go @@ -101,7 +101,6 @@ func (h *Hub) GetToken(tokenType, oldToken string, waitTime time.Duration) (toke case EventTypeWXToken: token = api.WeixinAPI.CBGetToken() case EventTypeYLYToken: - token = api.YilianyunAPI.GetToken() case EventTypeWeimobToken: if weimobToken := api.WeimobAPI.GetToken(); weimobToken != nil { token = string(utils.MustMarshal(weimobToken)) diff --git a/business/jxutils/tasks/configrefresh.go b/business/jxutils/tasks/configrefresh.go index 52f481566..b0ba7b769 100644 --- a/business/jxutils/tasks/configrefresh.go +++ b/business/jxutils/tasks/configrefresh.go @@ -15,7 +15,6 @@ import ( "git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/baseapi/platformapi/weimobapi" - "git.rosy.net.cn/baseapi/platformapi/yilianyunapi" "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/globals" @@ -255,33 +254,6 @@ func SaveWeimobToken(token *weimobapi.TokenInfo) (err error) { return dao.CreateOrUpdate(db, config) } -func RefreshYilianyunToken() (err error) { - return RefreshConfig("yilianyun", yilianyunTokenExpires, func() (token string, expireTimeStr string) { - globals.SugarLogger.Debugf("RefreshYilianyunToken RunMode:%s", beego.BConfig.RunMode) - if globals.IsMainProductEnv() { // 只有京西菜市刷新易联云key - if tokenInfo, err := api.YilianyunAPI.RetrieveToken(); err == nil { - token = string(utils.MustMarshal(tokenInfo)) - } else { - globals.SugarLogger.Errorf("RefreshYilianyunToken RefreshToken failed with error:%v", err) - } - } else { - if tokenInfo := getYLYTokenFromRemote(api.YilianyunAPI.GetToken()); tokenInfo != nil { - expireTimeStr = utils.Time2Str(time.Now().Add(-yilianyunTokenExpires)) - token = tokenInfo.Token - } - } - return token, expireTimeStr - }, func(value string) { - token := value - var tokenInfo *yilianyunapi.TokenInfo - if err := utils.TryUnmarshalUseNumber([]byte(value), &tokenInfo); err == nil { - token = tokenInfo.AccessToken - } - syseventhub.SysEventHub.OnNewYLYToken(token) - api.YilianyunAPI.SetToken(token) - }) -} - func PollingRemotEvent(remoteURL string, waitSecond int, params map[string]interface{}) (tokenInfo *syseventhub.TokenInfo) { if waitSecond == 0 { waitSecond = 5 * 60