1上传草稿箱接口改用国际版 2配套相关登录、cookie保存、导出、导入等功能
This commit is contained in:
1 parent
c032747651
commit
096e1a450d
20 files changed
+825
-249
No files matched your search
@@ -182,21 +182,43 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
s.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd");
|
||||
}
|
||||
StartUp.SaveLocalShopLoginInfo(); // 店铺保存到本地
|
||||
ShopListForm.UpdateServerShopCookies(shop, shop.Cookies); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie
|
||||
OnSaveComplete(shop);
|
||||
if (this.Created && this.chkCloseAfterLogin.Checked)
|
||||
{
|
||||
Invoke(new Action(() => { this.Close(); }));
|
||||
}
|
||||
else
|
||||
break;
|
||||
ShopListForm.UpdateServerShopCookies(shop); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie
|
||||
//OnSaveComplete(shop);
|
||||
//if (this.Created && this.chkCloseAfterLogin.Checked)
|
||||
//{
|
||||
// Invoke(new Action(() => { this.Close(); }));
|
||||
//}
|
||||
//else
|
||||
// break;
|
||||
}
|
||||
//cefWebBrowser.Load(shopMainUrl2);
|
||||
var shopStatusRst = ShopListForm.GetShopStatus2(shop);
|
||||
if (!shopStatusRst.Contains("\"success\":true"))
|
||||
{
|
||||
//https://agentseller.temu.com/main/authentication?redirectUrl=https%3A%2F%2Fagentseller.temu.com&mallId=634418217169109&asCode=7PaagItuW7ZD1xw2IXNU198596bf60a24327b02d32da6d43f9bcbc40a4b925d0b2ba8c28bd
|
||||
var codeRst = ShopListForm.GetShopLogin2Code(shop);
|
||||
if (codeRst.Contains("\"success\":true"))
|
||||
{
|
||||
string code = BaseRegex.GetStringJson(ref codeRst, "code");
|
||||
cefWebBrowser.Load("https://agentseller.temu.com/main/authentication" +
|
||||
"?redirectUrl=https%3A%2F%2Fagentseller.temu.com&mallId=" + shop.ShopId +
|
||||
"&asCode=" + code);
|
||||
}
|
||||
else
|
||||
{
|
||||
cefWebBrowser.Load("https://agentseller.temu.com");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cefWebBrowser.Load("https://agentseller.temu.com");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (1 == 2 && this.shop != null && currentUrl.TrimEnd('/') == shopMainUrl2)
|
||||
{//https://agentseller.temu.com
|
||||
if (1 == 1 && this.shop != null && currentUrl.TrimEnd('/') == shopMainUrl2)
|
||||
{
|
||||
//https://agentseller.temu.com
|
||||
if (!cefWebBrowser.GetBrowser().MainFrame.IsValid)
|
||||
continue;
|
||||
|
||||
@@ -213,10 +235,10 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
foreach (var cookie in cookieList2)
|
||||
{
|
||||
//SUB_PASS_ID同时出现两个,domain是seller.kuajingmaihuo.com才是能登录店铺后台的
|
||||
if (cookie.Name == "seller_temp" && cookie.Domain != "agentseller.temu.com")
|
||||
continue;
|
||||
if (cookie.Name == "mallid" && cookie.Domain != "agentseller.temu.com")
|
||||
continue;
|
||||
//if (cookie.Name == "seller_temp" && cookie.Domain != "agentseller.temu.com")
|
||||
// continue;
|
||||
//if (cookie.Name == "mallid" && cookie.Domain != "agentseller.temu.com")
|
||||
// continue;
|
||||
|
||||
cookies2 += cookie.Name + "=" + cookie.Value + "; ";
|
||||
}
|
||||
@@ -263,12 +285,12 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
var lstShop = GlobalConfig.ShopLoginList.Where(l => l.LoginName == shop.LoginName).ToList();
|
||||
foreach (var s in lstShop)
|
||||
{
|
||||
s.LoginStatus = "登录成功";
|
||||
s.LoginStatus2 = "国际版在线";
|
||||
s.Cookies2 = cookies2;
|
||||
s.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd");
|
||||
}
|
||||
StartUp.SaveLocalShopLoginInfo(); // 店铺保存到本地
|
||||
ShopListForm.UpdateServerShopCookies(shop, shop.Cookies); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie
|
||||
ShopListForm.UpdateServerShopCookies(shop); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie
|
||||
OnSaveComplete(shop);
|
||||
if (this.Created && this.chkCloseAfterLogin.Checked)
|
||||
{
|
||||
@@ -380,9 +402,10 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
options: new BindingOptions { Binder = BindingOptions.DefaultBinder.Binder /*CamelCaseJavascriptNames = false*/ /*cef79*/ }
|
||||
);
|
||||
|
||||
|
||||
if (shop.Cookies == null)
|
||||
shop.Cookies = "";
|
||||
if (shop.Cookies2 == null)
|
||||
shop.Cookies2 = "";
|
||||
|
||||
var cookie = shop.Cookies;
|
||||
if (isMultiLogin)
|
||||
@@ -407,6 +430,7 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
if (!string.IsNullOrEmpty(shop.ShopId))
|
||||
{
|
||||
var storageJsCode = "window.localStorage.setItem('" + "mall-info-id" + "', '" + shop.ShopId + "');\r\n";
|
||||
storageJsCode += "window.localStorage.setItem('" + "agentseller-mall-info-id" + "', '" + shop.ShopId + "');\r\n";
|
||||
while (!cefWebBrowser.IsBrowserInitialized || !cefWebBrowser.GetBrowser().MainFrame.IsValid)
|
||||
Thread.Sleep(20);
|
||||
cefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(storageJsCode);
|
||||
@@ -577,7 +601,8 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
// });
|
||||
//}
|
||||
// 库存上传按钮
|
||||
if (currentUrl.StartsWith("https://seller.kuajingmaihuo.com/goods/product/list"))
|
||||
if (currentUrl.StartsWith("https://seller.kuajingmaihuo.com/goods/product/list") ||
|
||||
currentUrl.StartsWith("https://agentseller.temu.com/goods/list"))
|
||||
{
|
||||
Task.Run(() => {
|
||||
string sAddInputJs = @"
|
||||
|
||||
Reference in new issue
Block a user