设置有所cookie到数据库

This commit is contained in:
苏尹岚
2020-03-02 16:34:24 +08:00
parent 8c65204007
commit 0d8f586b0a
3 changed files with 29 additions and 10 deletions

View File

@@ -6,6 +6,8 @@ import (
"sync"
"time"
"git.rosy.net.cn/baseapi/platformapi/jdapi"
"git.rosy.net.cn/jx-callback/business/partner/purchase/jx/localjx"
"git.rosy.net.cn/jx-callback/globals/api"
@@ -114,6 +116,9 @@ var (
ebaiStorePageCookieWMUSS string
ebaiStorePageCookieWMSTOKEN string
mtwmCookieStr string
mtpsStoreToken string
jd2StorePageCookie string
JdStorePageCookie string
)
func GetImportantTaskID(taskName string) string {
@@ -226,6 +231,15 @@ func Init() {
if configs, err := dao.QueryConfigs(dao.GetDB(), "mtwmCookieStr", model.ConfigTypeCookie, ""); err == nil {
mtwmCookieStr = configs[0].Value
}
if configs, err := dao.QueryConfigs(dao.GetDB(), "mtpsStoreToken", model.ConfigTypeCookie, ""); err == nil {
mtpsStoreToken = configs[0].Value
}
if configs, err := dao.QueryConfigs(dao.GetDB(), "jdStorePageCookie", model.ConfigTypeCookie, ""); err == nil {
JdStorePageCookie = configs[0].Value
}
if configs, err := dao.QueryConfigs(dao.GetDB(), "jd2StorePageCookie", model.ConfigTypeCookie, ""); err == nil {
jd2StorePageCookie = configs[0].Value
}
api.EbaiAPI.SetCookie("PASSPORT_DELIMONT_TOKEN", ebaiStorePageCookieExdTOKEN)
api.EbaiAPI.SetCookie("WMUSS", ebaiStorePageCookieWMUSS)
api.EbaiAPI.SetCookie("WMSTOKEN", ebaiStorePageCookieWMSTOKEN)
@@ -233,6 +247,11 @@ func Init() {
api.Ebai2API.SetCookie("WMUSS", ebaiStorePageCookieWMUSS2)
api.Ebai2API.SetCookie("WMSTOKEN", ebaiStorePageCookieWMSTOKEN2)
api.MtwmAPI.SetCookieWithStr(mtwmCookieStr)
api.MtpsAPI.SetCookie("token", mtpsStoreToken)
api.Jd2API.SetJdCookie(jd2StorePageCookie)
api.JdAPI.SetJdCookie(JdStorePageCookie)
api.JdPageAPI.SetCookie(jdapi.AccessStorePageCookieName, JdStorePageCookie)
api.JdPageAPI.SetCookie(jdapi.AccessStorePageCookieName2, JdStorePageCookie)
}
func syncStoreSku() {