1
This commit is contained in:
@@ -2,10 +2,12 @@ package apimanager
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
||||
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
@@ -13,6 +15,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
beego "github.com/astaxie/beego/server/web"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -78,8 +81,10 @@ func (a *APIManager) GetAPI(vendorID int, appOrgCode string) (pfAPI interface{})
|
||||
if code.Token != "" {
|
||||
var tokenInfo *tao_vegetable.StoreTokenInfo
|
||||
json.Unmarshal([]byte(code.Token), &tokenInfo)
|
||||
if tokenInfo.AccessToken != "" {
|
||||
if tokenInfo.AccessToken != "" && tokenInfo.ExpireTime <= time.Now().UnixNano()/1e6 {
|
||||
api.SetToken(tokenInfo.AccessToken)
|
||||
} else {
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "DDC5657B43EE11E9A9FF525400E86DC0", "淘鲜达token过期", ",请重新授权")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user