1库存上传重组标题功能 2优化国际版cookie登录功能 3拒绝跟架功能移植新接口完成
This commit is contained in:
1 parent
096e1a450d
commit
c203c161a2
46 files changed
+976
-6690
No files matched your search
@@ -51,7 +51,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
}
|
||||
else
|
||||
{
|
||||
var list = GlobalConfig.ShopLoginList.Where(s => s.LoginStatus == "登录成功").Select(ss => ss.ShopId);
|
||||
var list = GlobalConfig.ShopLoginList.Where(s => s.LoginStatus2 == "国际版在线").Select(ss => ss.ShopId);
|
||||
foreach (DataGridViewRow row in dgvShop.Rows)
|
||||
{
|
||||
if (list.Any(l => l == row.Cells["colShopId"]?.Value?.ToString()))
|
||||
@@ -98,7 +98,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
if (selectShopId == null)
|
||||
selectShopId = new List<string>();
|
||||
|
||||
bool canUse = shopEntity.LoginStatus == "登录成功";
|
||||
bool canUse = shopEntity.LoginStatus2 == "国际版在线";
|
||||
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == shopEntity.ShopId);
|
||||
if (row == null)
|
||||
{
|
||||
@@ -107,7 +107,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
shopEntity.LoginName,
|
||||
shopEntity.ShopId,
|
||||
shopEntity.ShopAccount,
|
||||
shopEntity.LoginStatus,
|
||||
shopEntity.LoginStatus2 == "国际版在线" ? "在线" : "未登录",
|
||||
canUse,
|
||||
string.Empty
|
||||
);
|
||||
@@ -117,7 +117,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
row.Cells["colSelect"].Value = selectShopId.Contains(shopEntity.ShopId) && canUse;
|
||||
row.Cells["colShopLoginName"].Value = shopEntity.LoginName;
|
||||
row.Cells["colShopName"].Value = shopEntity.ShopAccount;
|
||||
row.Cells["colLoginStatus"].Value = shopEntity.LoginStatus;
|
||||
row.Cells["colLoginStatus"].Value = shopEntity.LoginStatus2 == "国际版在线" ? "在线" : "未登录";
|
||||
row.Cells["colCanUse"].Value = canUse;
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,9 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
switch (columnName)
|
||||
{
|
||||
case "colSelect":
|
||||
dgvShop.CellContentClick -= dgvShop_CellContentClick;
|
||||
dgvShop_CellContentClick(sender, e);
|
||||
//dgvShop.CellContentClick += dgvShop_CellContentClick;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -159,7 +161,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseMsgForm.ShowInfo("店铺未登录!");
|
||||
BaseMsgForm.ShowInfo("店铺国际版未登录!");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -226,14 +228,14 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
continue;
|
||||
|
||||
#region 检测登录
|
||||
if (shop.LoginStatus != "登录成功")
|
||||
if (shop.LoginStatus2 != "国际版在线")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (ShopListForm.Instance == null)
|
||||
ShopListForm.Instance = new ShopListForm();
|
||||
ShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false);
|
||||
if (shop.LoginStatus != "登录成功")
|
||||
if (shop.LoginStatus2 != "国际版在线")
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
@@ -241,7 +243,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colMessage"].Value = "店铺掉线";
|
||||
row.Cells["colLoginStatus"].Value = "未登录";
|
||||
row.Cells["colLoginStatus"].Value = "国际版未登录";
|
||||
row.Cells["colCanUse"].Value = false;
|
||||
}
|
||||
}));
|
||||
@@ -393,16 +395,19 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
private string GetPriceAdjustList(ShopLoginInfo shop, int page = 1, string type = "待调价")
|
||||
{
|
||||
page = Math.Max(page, 1);
|
||||
string url = "https://seller.kuajingmaihuo.com/marvel-mms/cn/api/kiana/magneto/price-adjust/page-query";
|
||||
//string url = "https://seller.kuajingmaihuo.com/marvel-mms/cn/api/kiana/magneto/price-adjust/page-query";
|
||||
string url = "https://agentseller.temu.com/api/kiana/mms/magneto/price-adjust/page-query";
|
||||
string body;
|
||||
if (type == "待调价")
|
||||
body = @"{""pageInfo"":{""pageSize"":10,""pageNo"":" + page + @"},""status"":1,""quickSearch"":[]}";
|
||||
else
|
||||
body = @"{""pageInfo"":{""pageSize"":10,""pageNo"":" + page + @"},""status"":2,""quickSearch"":[]}";
|
||||
|
||||
string refere = "https://seller.kuajingmaihuo.com/main/price-manage/price-adjustment";
|
||||
//string refere = "https://seller.kuajingmaihuo.com/main/price-manage/price-adjustment";
|
||||
string refere = "https://agentseller.temu.com/main/adjust-price-manage/order-price";
|
||||
|
||||
return KJDHttpResponse.PostResponse(shop, url, body, refere);
|
||||
//return KJDHttpResponse.PostResponse(shop, url, body, refere);
|
||||
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
|
||||
}
|
||||
|
||||
private void panelEx1_Click(object sender, EventArgs e)
|
||||
@@ -476,7 +481,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
}
|
||||
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == priceAdjust.supplierId.ToString());
|
||||
if (shop == null || shop.LoginStatus != "登录成功")
|
||||
if (shop == null || shop.LoginStatus2 != "国际版在线")
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
@@ -556,7 +561,8 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
/// <returns></returns>
|
||||
private string refuseAdjust(ShopLoginInfo shop, List<string> adjustIdList, string refuseReason)
|
||||
{
|
||||
string url = "https://seller.kuajingmaihuo.com/marvel-mms/cn/api/kiana/gmp/bg/magneto/api/price-adjust/batch/adjust";
|
||||
//string url = "https://seller.kuajingmaihuo.com/marvel-mms/cn/api/kiana/gmp/bg/magneto/api/price-adjust/batch/adjust";
|
||||
string url = "https://agentseller.temu.com/api/kiana/mms/gmp/bg/magneto/api/price-adjust/batch/adjust";
|
||||
string body = "{\"adjustList\":[";
|
||||
foreach (var adjustId in adjustIdList)
|
||||
{
|
||||
@@ -564,9 +570,10 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
}
|
||||
body = body.TrimEnd(',');
|
||||
body += "]}";
|
||||
string refere = "https://seller.kuajingmaihuo.com/main/price-manage/price-adjustment";
|
||||
//string refere = "https://seller.kuajingmaihuo.com/main/price-manage/price-adjustment";
|
||||
string refere = "https://agentseller.temu.com/main/adjust-price-manage/order-price";
|
||||
|
||||
return KJDHttpResponse.PostResponse(shop, url, body, refere);
|
||||
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
|
||||
}
|
||||
|
||||
private void dgvStock_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
||||
|
||||
@@ -81,6 +81,17 @@ namespace TemuKJD.KJDForms
|
||||
/// <returns></returns>
|
||||
public static string PostResponse2(ShopLoginInfo shop, string _url, string _data, string referer)
|
||||
{
|
||||
var cookiesArr = shop.Cookies2.Split(';').Select(s => s.Trim());
|
||||
string cookies = "";
|
||||
foreach(var cook in cookiesArr)
|
||||
{
|
||||
if (cook.StartsWith("mallid"))
|
||||
cookies += "mallid=" + shop.ShopId + "; ";
|
||||
else
|
||||
cookies += cook + "; ";
|
||||
}
|
||||
cookies = cookies.Trim().TrimEnd(';');
|
||||
|
||||
HttpWebResponse response = null;
|
||||
string result;
|
||||
try
|
||||
@@ -106,7 +117,7 @@ namespace TemuKJD.KJDForms
|
||||
request.Referer = referer;
|
||||
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
|
||||
request.Headers.Set(HttpRequestHeader.AcceptLanguage, "zh-CN,zh;q=0.9");
|
||||
request.Headers.Set(HttpRequestHeader.Cookie, shop.Cookies2);
|
||||
request.Headers.Set(HttpRequestHeader.Cookie, cookies);
|
||||
|
||||
request.Method = "POST";
|
||||
request.ServicePoint.Expect100Continue = false;
|
||||
|
||||
Reference in new issue
Block a user