api接口上货

This commit is contained in:
wule_5900x committed 2026-01-31 21:15:42 +08:00
1 parent afaabea1fa
commit 50ae0c3ce4
24 files changed
+511 -200

No files matched your search

@@ -976,7 +976,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private void btnGetAllCate_Click(object sender, EventArgs e)
{
new WxApiBLL().GetWxToken();
new WxApiBLL().GetRandomWxToken();
var url1 = BaseClass.BuildPDDObjString("product/get_wx_all_cate");
var data1 = UserLogin.GetSignaturex();
@@ -1055,7 +1055,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.statusBar.lblTaskStatus.Text = "正在识别微信类目 " + this.statusBar.pgbTaskProgress.Value + "/" + dbProdLst.Count;
}));
// 获取微信accessToken
var token = new WxApiBLL().GetWxToken();
var token = new WxApiBLL().GetRandomWxToken();
try
{
JObject obj = new JObject();
@@ -1073,7 +1073,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
var urlImg = BaseClass.BuildPDDObjString("product/wx_api_upload_image");
var upDate = UserLogin.GetSignaturex();
upDate += "&token=" + token;
upDate += "&token=" + token.accessToken;
upDate += "&post_data=" + GetHtml.UrlEncodeUtf8("{\"img_url\":\"" + img + "\"}");
var upDateRst = GetHtml.PostUtf8(urlImg, upDate);
var upImgUrl = BaseRegex.GetStringJson(ref upDateRst, "img_url");
@@ -1085,7 +1085,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var url1 = BaseClass.BuildPDDObjString("product/wx_api_category_classify");
var data1 = UserLogin.GetSignaturex();
data1 += "&token=" + token;
data1 += "&token=" + token.accessToken;
data1 += "&post_data=" + GetHtml.UrlEncodeUtf8(post_data);
var html1 = GetHtml.PostUtf8(url1, data1);
var catId = BaseRegex.GetStringJson(ref html1, "cat_id");
@@ -1259,7 +1259,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
continue;
}
var prodDataStr = JsonHelper.SerializeObject(JsonHelper.JObjectParse(rst)["data"]);
var prodDataStr = "";
try
{
var prodDataObj = JsonHelper.JObjectParse(rst)["data"];
prodDataObj["spuCode"] = dbProd.ext_code;
prodDataStr = JsonHelper.SerializeObject(prodDataObj);
}
catch
{
continue;
}
string url = "https://po.e57.cn/prod-api/api/sys-api/system/open/api/addGoods";
var exportRst = WXHttpResponseBLL.e57PostResponse(url, prodDataStr, "");
Thread.Sleep(500);
@@ -1394,7 +1404,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var spuCodes = string.Join("\",\"", dbProdTmp20Lst.Select(p => p.ext_code));
// 原批量拉取,已废弃 "https://po.e57.cn/prod-api/api/sys-api/system/open/api/goods/list/get?page_size=10";
// 按spuCode(ext_code)拉取
string url = "https://po.e57.cn/prod-api/api/sys-api/system/open/api/goods/list/get";
string url = "https://po.e57.cn/prod-api/api/sys-api/system/open/api/goods/list/get?" + Randomx.GetId(100,999);
string body = "{\"spuCodes\":[\"" + spuCodes + "\"]}";
var getRst = WXHttpResponseBLL.e57PostResponse(url, body, "");
Thread.Sleep(500);