aa
This commit is contained in:
@@ -155,27 +155,27 @@ func OnTokenChange(values url.Values) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
voc := &model.VendorOrgCode{}
|
voc := &model.VendorOrgCode{}
|
||||||
sql := `
|
//sql := `
|
||||||
SELECT * FROM tmp_jd WHERE vendor_org_code = ?
|
// SELECT * FROM tmp_jd WHERE vendor_org_code = ?
|
||||||
`
|
//`
|
||||||
sqlParams := []interface{}{tokenInfo.VenderID}
|
//sqlParams := []interface{}{tokenInfo.VenderID}
|
||||||
if err := dao.GetRow(db, &voc, sql, sqlParams); err == nil && voc != nil {
|
//if err := dao.GetRow(db, &voc, sql, sqlParams); err == nil && voc != nil {
|
||||||
if result, _ := dao.GetVendorOrgCode(db, model.VendorIDJD, voc.VendorOrgCode, model.VendorOrgTypePlatform); len(result) > 0 {
|
if result, _ := dao.GetVendorOrgCode(db, model.VendorIDJD, voc.VendorOrgCode, model.VendorOrgTypePlatform); len(result) > 0 {
|
||||||
result[0].Token = tokenInfo.Token
|
result[0].Token = tokenInfo.Token
|
||||||
if _, err = dao.UpdateEntity(db, result[0], "Token"); err == nil {
|
if _, err := dao.UpdateEntity(db, result[0], "Token"); err == nil {
|
||||||
//添加成功后去开发者后台填验证码
|
//添加成功后去开发者后台填验证码
|
||||||
// if configs, err := dao.QueryConfigs(dao.GetDB(), "jdConfigCookie", model.ConfigTypeCookie, ""); err == nil {
|
// if configs, err := dao.QueryConfigs(dao.GetDB(), "jdConfigCookie", model.ConfigTypeCookie, ""); err == nil {
|
||||||
// api.JdAPI.SetCookieWithStr(configs[0].Value)
|
// api.JdAPI.SetCookieWithStr(configs[0].Value)
|
||||||
// result2, _ := api.JdAPI.GetJdAppInfo()
|
// result2, _ := api.JdAPI.GetJdAppInfo()
|
||||||
// result[0].AppKey = result2.AppKey
|
// result[0].AppKey = result2.AppKey
|
||||||
// result[0].AppSecret = result2.AppSecret
|
// result[0].AppSecret = result2.AppSecret
|
||||||
// dao.UpdateEntity(db, result[0], "AppKey", "AppSecret")
|
// dao.UpdateEntity(db, result[0], "AppKey", "AppSecret")
|
||||||
// }
|
// }
|
||||||
}
|
|
||||||
} else {
|
|
||||||
globals.SugarLogger.Debugf("OnTokenChange, 发token,但是库里没这个账号")
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
globals.SugarLogger.Debugf("OnTokenChange, 发token,但是库里没这个账号")
|
||||||
}
|
}
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user