cookie设置在newconfig

This commit is contained in:
苏尹岚
2020-03-02 15:41:45 +08:00
parent 2b4d90927a
commit 0dca8a5d95
4 changed files with 20 additions and 4 deletions

View File

@@ -111,6 +111,9 @@ var (
ebaiStorePageCookieExdTOKEN string
ebaiStorePageCookieWMUSS2 string
ebaiStorePageCookieWMSTOKEN2 string
ebaiStorePageCookieWMUSS string
ebaiStorePageCookieWMSTOKEN string
mtwmCookieStr string
)
func GetImportantTaskID(taskName string) string {
@@ -214,10 +217,22 @@ func Init() {
if configs, err := dao.QueryConfigs(dao.GetDB(), "ebaiStorePageCookieWMSTOKEN2", model.ConfigTypeCookie, ""); err == nil {
ebaiStorePageCookieWMSTOKEN2 = configs[0].Value
}
if configs, err := dao.QueryConfigs(dao.GetDB(), "ebaiStorePageCookieWMUSS", model.ConfigTypeCookie, ""); err == nil {
ebaiStorePageCookieWMUSS = configs[0].Value
}
if configs, err := dao.QueryConfigs(dao.GetDB(), "ebaiStorePageCookieWMSTOKEN", model.ConfigTypeCookie, ""); err == nil {
ebaiStorePageCookieWMSTOKEN = configs[0].Value
}
if configs, err := dao.QueryConfigs(dao.GetDB(), "mtwmCookieStr", model.ConfigTypeCookie, ""); err == nil {
mtwmCookieStr = configs[0].Value
}
api.EbaiAPI.SetCookie("PASSPORT_DELIMONT_TOKEN", ebaiStorePageCookieExdTOKEN)
api.EbaiAPI.SetCookie("WMUSS", ebaiStorePageCookieWMUSS)
api.EbaiAPI.SetCookie("WMSTOKEN", ebaiStorePageCookieWMSTOKEN)
api.Ebai2API.SetCookie("PASSPORT_DELIMONT_TOKEN", ebaiStorePageCookieExdTOKEN)
api.Ebai2API.SetCookie("WMUSS", ebaiStorePageCookieWMUSS2)
api.Ebai2API.SetCookie("WMSTOKEN", ebaiStorePageCookieWMSTOKEN2)
api.MtwmAPI.SetCookieWithStr(mtwmCookieStr)
}
func syncStoreSku() {