cookie
This commit is contained in:
@@ -137,6 +137,7 @@ var (
|
|||||||
feiePageCookie string
|
feiePageCookie string
|
||||||
jdStorePageEarning string
|
jdStorePageEarning string
|
||||||
jdsCookie string
|
jdsCookie string
|
||||||
|
jdsCookie2 string
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetImportantTaskID(taskName string) string {
|
func GetImportantTaskID(taskName string) string {
|
||||||
@@ -340,8 +341,8 @@ func Init() {
|
|||||||
api.JdShopAPI.SetCookieWithStr(jdsCookie)
|
api.JdShopAPI.SetCookieWithStr(jdsCookie)
|
||||||
}
|
}
|
||||||
if configs, err := dao.QueryConfigs(dao.GetDB(), "jdsCookie2", model.ConfigTypeCookie, ""); err == nil {
|
if configs, err := dao.QueryConfigs(dao.GetDB(), "jdsCookie2", model.ConfigTypeCookie, ""); err == nil {
|
||||||
jdsCookie = configs[0].Value
|
jdsCookie2 = configs[0].Value
|
||||||
api.JdShop2API.SetCookieWithStr(jdsCookie)
|
api.JdShop2API.SetCookieWithStr(jdsCookie2)
|
||||||
}
|
}
|
||||||
if configs, err := dao.QueryConfigs(dao.GetDB(), "yinbaoCookie", model.ConfigTypeCookie, ""); err == nil {
|
if configs, err := dao.QueryConfigs(dao.GetDB(), "yinbaoCookie", model.ConfigTypeCookie, ""); err == nil {
|
||||||
yinbaoCookie := configs[0].Value
|
yinbaoCookie := configs[0].Value
|
||||||
|
|||||||
@@ -1729,32 +1729,42 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
|||||||
err = dao.CreateEntity(db, storeMap)
|
err = dao.CreateEntity(db, storeMap)
|
||||||
|
|
||||||
if shopDetailResult, err := api.JdShop2API.ShopDetail(utils.Str2Int(vendorStoreID)); err == nil {
|
if shopDetailResult, err := api.JdShop2API.ShopDetail(utils.Str2Int(vendorStoreID)); err == nil {
|
||||||
err = api.JdShop2API.UpdateBasic(&jdshopapi.UpdateBasicParam{
|
if store.Licence != "" {
|
||||||
StoreID: utils.Str2Int(vendorStoreID),
|
data, _, _ := jxutils.DownloadFileByURL(store.Licence)
|
||||||
StoreName: shopDetailResult.StoreName,
|
fileName := store.Licence[strings.LastIndex(store.Licence, "/")+1 : len(store.Licence)]
|
||||||
CategoryID2: 62,
|
url, _ := api.JdShop2API.UploadImageNew(data, fileName)
|
||||||
Coordinate: shopDetailResult.Coordinate,
|
ex := store.LicenceExpire
|
||||||
BussinessBeginTime: shopDetailResult.BussinessBeginTime,
|
if ex == "" {
|
||||||
BussinessEndTime: shopDetailResult.BussinessEndTime,
|
ex = utils.Time2Str(utils.Str2Time(store.LicenceValid).AddDate(0, 6, 0))
|
||||||
ImgURL: shopDetailResult.ImgURL,
|
}
|
||||||
StorePhone: shopDetailResult.StorePhone,
|
err = api.JdShop2API.UpdateBasic(&jdshopapi.UpdateBasicParam{
|
||||||
AddName: shopDetailResult.AddName,
|
StoreID: utils.Str2Int(vendorStoreID),
|
||||||
AddCode1: shopDetailResult.AddCode1,
|
StoreName: shopDetailResult.StoreName,
|
||||||
AddCode2: shopDetailResult.AddCode2,
|
CategoryID2: 62,
|
||||||
AddCode3: shopDetailResult.AddCode3,
|
Coordinate: shopDetailResult.Coordinate,
|
||||||
CategoryID1: 34,
|
BussinessBeginTime: shopDetailResult.BussinessBeginTime,
|
||||||
QualificationRequests: []*jdshopapi.QualificationRequests{
|
BussinessEndTime: shopDetailResult.BussinessEndTime,
|
||||||
&jdshopapi.QualificationRequests{
|
ImgURL: shopDetailResult.ImgURL,
|
||||||
QualificationID: 41,
|
StorePhone: shopDetailResult.StorePhone,
|
||||||
QualificationName: "营业执照",
|
AddName: shopDetailResult.AddName,
|
||||||
QualificationNo: "11111",
|
AddCode1: shopDetailResult.AddCode1,
|
||||||
QualificationURL: "jfs/t1/148622/37/14846/10266/5fb4e3e2Ef2f61870/a7cfba9c1513d95e.png",
|
AddCode2: shopDetailResult.AddCode2,
|
||||||
StartTime: "2020-11-04 00:00:00",
|
AddCode3: shopDetailResult.AddCode3,
|
||||||
EndingTime: "2020-11-06 23:59:59",
|
CategoryID1: 34,
|
||||||
Time: []string{"2020-11-04 00:00:00", "2020-11-06 23:59:59"},
|
QualificationRequests: []*jdshopapi.QualificationRequests{
|
||||||
|
&jdshopapi.QualificationRequests{
|
||||||
|
QualificationID: 41,
|
||||||
|
QualificationName: "营业执照",
|
||||||
|
QualificationNo: store.LicenceCode,
|
||||||
|
QualificationURL: url,
|
||||||
|
StartTime: utils.Time2Str(utils.Str2Time(store.LicenceValid)),
|
||||||
|
EndingTime: ex,
|
||||||
|
Time: []string{utils.Time2Str(utils.Str2Time(store.LicenceValid)), ex},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
})
|
||||||
})
|
}
|
||||||
|
err = api.JdShop2API.UpdateExpand(utils.Str2Int(vendorStoreID))
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user