1
This commit is contained in:
@@ -85,7 +85,7 @@ func (a *APIManager) GetAPI(vendorID int, appOrgCode string) (pfAPI interface{})
|
|||||||
globals.SugarLogger.Debugf("code token :======= %s", utils.Format4Output(code.Token, false))
|
globals.SugarLogger.Debugf("code token :======= %s", utils.Format4Output(code.Token, false))
|
||||||
var tokenInfo *tao_vegetable.StoreTokenInfo
|
var tokenInfo *tao_vegetable.StoreTokenInfo
|
||||||
json.Unmarshal([]byte(code.Token), &tokenInfo)
|
json.Unmarshal([]byte(code.Token), &tokenInfo)
|
||||||
if tokenInfo.AccessToken != "" && tokenInfo.ExpireTime <= time.Now().UnixNano()/1e6 {
|
if tokenInfo.AccessToken != "" && tokenInfo.ExpireTime > time.Now().UnixNano()/1e6 {
|
||||||
api.SetToken(tokenInfo.AccessToken)
|
api.SetToken(tokenInfo.AccessToken)
|
||||||
globals.SugarLogger.Debugf("get token :======= %s", utils.Format4Output(api.GetToken(), false))
|
globals.SugarLogger.Debugf("get token :======= %s", utils.Format4Output(api.GetToken(), false))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user