This commit is contained in:
苏尹岚
2021-03-29 11:08:10 +08:00
parent 69bcb8a6aa
commit 34841c3bfd
2 changed files with 83 additions and 15 deletions

View File

@@ -1879,21 +1879,20 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
// tasksch.HandleTask(task, nil, true).Run()
// _, err = task.GetResult(0)
//京东账号更新
// var (
// db = dao.GetDB()
// )
// if configs, err := dao.QueryConfigs(dao.GetDB(), "jdConfigCookie", model.ConfigTypeCookie, ""); err == nil {
// api.JdAPI.SetCookieWithStr(configs[0].Value)
// result, _ := api.JdAPI.GetJdAppInfo()
// if result != nil {
// if vocs, _ := dao.GetVendorOrgCode(db, model.VendorIDJD, result.OrgCode, model.VendorOrgTypePlatform); len(vocs) > 0 {
// vocs[0].AppKey = result.AppKey
// vocs[0].AppSecret = result.AppSecret
// dao.UpdateEntity(db, vocs[0], "AppKey", "AppSecret")
// }
// }
// }
cms.RefreshStoreBind(ctx)
var (
db = dao.GetDB()
)
if configs, err := dao.QueryConfigs(dao.GetDB(), "jdConfigCookie", model.ConfigTypeCookie, ""); err == nil {
api.JdAPI.SetCookieWithStr(configs[0].Value)
result, _ := api.JdAPI.GetJdAppInfo()
if result != nil {
if vocs, _ := dao.GetVendorOrgCode(db, model.VendorIDJD, result.OrgCode, model.VendorOrgTypePlatform); len(vocs) > 0 {
vocs[0].AppKey = result.AppKey
vocs[0].AppSecret = result.AppSecret
dao.UpdateEntity(db, vocs[0], "AppKey", "AppSecret")
}
}
}
return err
}