This commit is contained in:
苏尹岚
2021-03-23 16:55:41 +08:00
parent 97a9605712
commit 08ddc2308d

View File

@@ -1882,12 +1882,15 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
var (
db = dao.GetDB()
)
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")
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