1更新cef版本到138 2其他一些小改动

This commit is contained in:
wule_5900x committed 2025-08-13 15:22:25 +08:00
1 parent 800ccb857d
commit c5be88568c
161 files changed
+1670 -6757

No files matched your search

+167 -147
View File
@@ -35,7 +35,7 @@ namespace TemuKJD.KJDForms.ShopForms
shopLoginInfo = shop;
updateFrom = from;
cookieVersion = _cookieVersion;
this.TitleText = "更新" + cookieVersion + "Cookie";
this.TitleText = "更新Cookie";
if (cookieVersion == "国内版")
this.radioButton1.Checked = true;
else
@@ -84,159 +84,179 @@ namespace TemuKJD.KJDForms.ShopForms
}
cookieVersion = this.radioButton1.Checked ? "国内版" : "国际版";
if (cookieVersion == "国内版")
bool ok1 = false;
bool ok2 = false;
if (this.txtCookieJs1.Text.Contains("SUB_PASS_ID") || !string.IsNullOrWhiteSpace(txtSubPassId.Text))
{
string txt = this.txtCookieJs.Text;
txt = txt.Replace("SUB_PASS_ID=;", "").Replace("_nano_fp=;", "").Replace("api_uid=;", "")
.Replace("_bee=;", "").Replace("ru2k=;", "").Replace("_f77=;", "")
.Replace("_a42=;", "").Replace("rckk=;", "").Replace("ru1k=;", "");
ok1 = GetCookie1();
}
if (this.txtCookieJs2.Text.Contains("seller_temp") || !string.IsNullOrWhiteSpace(txtSellerTemp.Text)) // 国际版
{
ok2 = GetCookie2();
}
string api_uid = BaseRegex.GetStringCookie(ref txt, "api_uid").ParseToString().Trim('\'');
string _nano_fp = BaseRegex.GetStringCookie(ref txt, "_nano_fp").ParseToString().Trim('\'');
string _bee = BaseRegex.GetStringCookie(ref txt, "_bee").ParseToString().Trim('\'');
string _f77 = BaseRegex.GetStringCookie(ref txt, "_f77").ParseToString().Trim('\'');
string _a42 = BaseRegex.GetStringCookie(ref txt, "_a42").ParseToString().Trim('\'');
string rckk = BaseRegex.GetStringCookie(ref txt, "rckk").ParseToString().Trim('\'');
string ru1k = BaseRegex.GetStringCookie(ref txt, "ru1k").ParseToString().Trim('\'');
string ru2k = BaseRegex.GetStringCookie(ref txt, "ru2k").ParseToString().Trim('\'');
string SUB_PASS_ID = BaseRegex.GetStringCookie(ref txt, "SUB_PASS_ID").ParseToString().Trim('\'');
string cookie = "api_uid=" + api_uid + ";" +
"_nano_fp=" + _nano_fp + ";" +
"_bee=" + _bee + ";" +
"_f77=" + _f77 + ";" +
"_a42=" + _a42 + ";" +
"rckk=" + rckk + ";" +
"ru1k=" + ru1k + ";" +
"ru2k=" + ru2k + ";" +
"SUB_PASS_ID=" + SUB_PASS_ID + ";";
if (string.IsNullOrEmpty(SUB_PASS_ID))
{
BaseMsgForm.ShowError("Cookie缺少关键字段,请检查!");
return;
}
var cookieShop = new ShopLoginInfo();
cookieShop.Cookies = cookie;
var data = "";
data = ShopListForm.GetShopStatus(cookieShop);
if (!data.Contains("\"success\":true"))
{
BaseMsgForm.ShowError("cookie已失效!");
return;
}
var maskMobile = BaseRegex.GetStringJson(ref data, "maskOwnerMobile");
if (!shopLoginInfo.LoginName.EndsWith(maskMobile))
{
BaseMsgForm.ShowError("cookie与店铺不匹配,请核对店铺!");
return;
}
List<ShopLoginInfo> serverShopLst = new List<ShopLoginInfo>();
var rst = AdminShopListForm.AdminGetServerShopLstForSetCookie(shopLoginInfo, serverShopLst);
if (rst != "success")
{
BaseMsgForm.ShowError(rst);
return;
}
//如果店铺没有cookie登录过,处理店铺第一次登录(分裂cookie下的所有店铺)
GetShopFirstLogin(data, serverShopLst);
if (updateFrom == SetCookieFromEnum.normal_user) // 普通用户更新本地店铺
{
var localShop = GlobalConfig.ShopLoginList.Where(v => v.LoginName == shopLoginInfo.LoginName).ToList();
foreach (var sc in localShop)
{
sc.Cookies = cookie;
sc.LoginStatus = "登录成功";
}
}
shopLoginInfo.Cookies = cookie;
shopLoginInfo.LoginStatus = "登录成功";
ShopListForm.UpdateServerShopCookies(shopLoginInfo); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie
if (ok1 || ok2)
{
this.OnSaveComplete(shopLoginInfo);
this.Close();
}
else // 国际版
}
bool GetCookie1()
{
string txt = this.txtCookieJs1.Text;
txt = txt.Replace("SUB_PASS_ID=;", "").Replace("_nano_fp=;", "").Replace("api_uid=;", "")
.Replace("_bee=;", "").Replace("ru2k=;", "").Replace("_f77=;", "")
.Replace("_a42=;", "").Replace("rckk=;", "").Replace("ru1k=;", "");
string api_uid = BaseRegex.GetStringCookie(ref txt, "api_uid").ParseToString().Trim('\'');
string _nano_fp = BaseRegex.GetStringCookie(ref txt, "_nano_fp").ParseToString().Trim('\'');
string _bee = BaseRegex.GetStringCookie(ref txt, "_bee").ParseToString().Trim('\'');
string _f77 = BaseRegex.GetStringCookie(ref txt, "_f77").ParseToString().Trim('\'');
string _a42 = BaseRegex.GetStringCookie(ref txt, "_a42").ParseToString().Trim('\'');
string rckk = BaseRegex.GetStringCookie(ref txt, "rckk").ParseToString().Trim('\'');
string ru1k = BaseRegex.GetStringCookie(ref txt, "ru1k").ParseToString().Trim('\'');
string ru2k = BaseRegex.GetStringCookie(ref txt, "ru2k").ParseToString().Trim('\'');
string SUB_PASS_ID = BaseRegex.GetStringCookie(ref txt, "SUB_PASS_ID").ParseToString().Trim('\'');
if (!string.IsNullOrWhiteSpace(this.txtSubPassId.Text))
SUB_PASS_ID = this.txtSubPassId.Text.Trim();
string cookie = "api_uid=" + api_uid + ";" +
"_nano_fp=" + _nano_fp + ";" +
"_bee=" + _bee + ";" +
"_f77=" + _f77 + ";" +
"_a42=" + _a42 + ";" +
"rckk=" + rckk + ";" +
"ru1k=" + ru1k + ";" +
"ru2k=" + ru2k + ";" +
"SUB_PASS_ID=" + SUB_PASS_ID + ";";
if (string.IsNullOrEmpty(SUB_PASS_ID))
{
string txt = this.txtCookieJs.Text;
txt = txt.Replace("_bee=;", "").Replace("_nano_fp=;", "").Replace("api_uid=;", "")
.Replace("dilx=;", "").Replace("hfsc=;", "").Replace("mallid=;", "")
.Replace("njrpl=;", "").Replace("seller_temp=;", "");
string api_uid = BaseRegex.GetStringCookie(ref txt, "api_uid").ParseToString().Trim('\'');
string _nano_fp = BaseRegex.GetStringCookie(ref txt, "_nano_fp").ParseToString().Trim('\'');
string _bee = BaseRegex.GetStringCookie(ref txt, "_bee").ParseToString().Trim('\'');
string dilx = BaseRegex.GetStringCookie(ref txt, "dilx").ParseToString().Trim('\'');
string hfsc = BaseRegex.GetStringCookie(ref txt, "hfsc").ParseToString().Trim('\'');
string mallid = BaseRegex.GetStringCookie(ref txt, "mallid").ParseToString().Trim('\'');
string njrpl = BaseRegex.GetStringCookie(ref txt, "njrpl").ParseToString().Trim('\'');
string seller_temp = BaseRegex.GetStringCookie(ref txt, "seller_temp").ParseToString().Trim('\'');
string cookie2 = "api_uid=" + api_uid + ";" +
"_nano_fp=" + _nano_fp + ";" +
"_bee=" + _bee + ";" +
"dilx=" + dilx + ";" +
"hfsc=" + hfsc + ";" +
"mallid=" + mallid + ";" +
"njrpl=" + njrpl + ";" +
"seller_temp=" + seller_temp + ";";
if (string.IsNullOrEmpty(seller_temp))
{
BaseMsgForm.ShowError("Cookie缺少关键字段,请检查!\r\n请从Temu国际版https://agentseller.temu.com处获得cookie");
return;
}
var cookieShop = new ShopLoginInfo();
cookieShop.Cookies2 = cookie2;
var data = ShopListForm.GetShopStatus2(cookieShop);
if (!data.Contains("\"success\":true"))
{
BaseMsgForm.ShowError("cookie已失效!");
return;
}
//var maskMobile = BaseRegex.GetStringJson(ref data, "maskOwnerMobile");
//if (!shopLoginInfo.LoginName.EndsWith(maskMobile))
if(!data.Contains(shopLoginInfo.ShopAccount))
{
BaseMsgForm.ShowError("cookie与店铺不匹配,请核对店铺!");
return;
}
List<ShopLoginInfo> serverShopLst = new List<ShopLoginInfo>();
var rst = AdminShopListForm.AdminGetServerShopLstForSetCookie(shopLoginInfo, serverShopLst);
if (rst != "success")
{
BaseMsgForm.ShowError(rst);
return;
}
//如果店铺没有cookie登录过,处理店铺第一次登录(分裂cookie下的所有店铺)
GetShopFirstLogin(data, serverShopLst);
if (updateFrom == SetCookieFromEnum.normal_user) // 普通用户更新本地店铺
{
var localShop = GlobalConfig.ShopLoginList.Where(v => v.LoginName == shopLoginInfo.LoginName).ToList();
foreach (var sc in localShop)
{
sc.Cookies = cookie2;
sc.LoginStatus = "登录成功";
}
}
shopLoginInfo.Cookies = cookie2;
shopLoginInfo.LoginStatus = "登录成功";
ShopListForm.UpdateServerShopCookies(shopLoginInfo); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie
this.OnSaveComplete(shopLoginInfo);
this.Close();
BaseMsgForm.ShowError("Cookie缺少关键字段,请检查!");
return false;
}
var cookieShop = new ShopLoginInfo();
cookieShop.Cookies = cookie;
var data = "";
data = ShopListForm.GetShopStatus(cookieShop);
if (!data.Contains("\"success\":true"))
{
BaseMsgForm.ShowError("cookie已失效!");
return false;
}
var maskMobile = BaseRegex.GetStringJson(ref data, "maskOwnerMobile");
if (!shopLoginInfo.LoginName.EndsWith(maskMobile))
{
BaseMsgForm.ShowError("cookie与国内版店铺不匹配,请核对店铺!");
return false;
}
List<ShopLoginInfo> serverShopLst = new List<ShopLoginInfo>();
var rst = AdminShopListForm.AdminGetServerShopLstForSetCookie(shopLoginInfo, serverShopLst);
if (rst != "success")
{
BaseMsgForm.ShowError(rst);
return false;
}
//如果店铺没有cookie登录过,处理店铺第一次登录(分裂cookie下的所有店铺)
GetShopFirstLogin(data, serverShopLst);
if (updateFrom == SetCookieFromEnum.normal_user) // 普通用户更新本地店铺
{
var localShop = GlobalConfig.ShopLoginList.Where(v => v.LoginName == shopLoginInfo.LoginName).ToList();
foreach (var sc in localShop)
{
sc.Cookies = cookie;
sc.LoginStatus = "登录成功";
}
}
shopLoginInfo.Cookies = cookie;
shopLoginInfo.LoginStatus = "登录成功";
ShopListForm.UpdateServerShopCookies(shopLoginInfo); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie
return true;
}
bool GetCookie2()
{
string txt = this.txtCookieJs2.Text;
txt = txt.Replace("_bee=;", "").Replace("_nano_fp=;", "").Replace("api_uid=;", "")
.Replace("dilx=;", "").Replace("hfsc=;", "").Replace("mallid=;", "")
.Replace("njrpl=;", "").Replace("seller_temp=;", "");
string api_uid = BaseRegex.GetStringCookie(ref txt, "api_uid").ParseToString().Trim('\'');
string _nano_fp = BaseRegex.GetStringCookie(ref txt, "_nano_fp").ParseToString().Trim('\'');
string _bee = BaseRegex.GetStringCookie(ref txt, "_bee").ParseToString().Trim('\'');
string dilx = BaseRegex.GetStringCookie(ref txt, "dilx").ParseToString().Trim('\'');
string hfsc = BaseRegex.GetStringCookie(ref txt, "hfsc").ParseToString().Trim('\'');
string mallid = BaseRegex.GetStringCookie(ref txt, "mallid").ParseToString().Trim('\'');
string njrpl = BaseRegex.GetStringCookie(ref txt, "njrpl").ParseToString().Trim('\'');
string seller_temp = BaseRegex.GetStringCookie(ref txt, "seller_temp").ParseToString().Trim('\'');
if (!string.IsNullOrWhiteSpace(txtSellerTemp.Text))
seller_temp = txtSellerTemp.Text.Trim();
string cookie2 = "api_uid=" + api_uid + ";" +
"_nano_fp=" + _nano_fp + ";" +
"_bee=" + _bee + ";" +
"dilx=" + dilx + ";" +
"hfsc=" + hfsc + ";" +
"mallid=" + mallid + ";" +
"njrpl=" + njrpl + ";" +
"seller_temp=" + seller_temp + ";";
if (string.IsNullOrEmpty(seller_temp))
{
BaseMsgForm.ShowError("Cookie缺少关键字段,请检查!\r\n请从Temu国际版https://agentseller.temu.com处获得cookie");
return false;
}
var cookieShop = new ShopLoginInfo();
cookieShop.Cookies2 = cookie2;
var data = ShopListForm.GetShopStatus2(cookieShop);
if (!data.Contains("\"success\":true"))
{
BaseMsgForm.ShowError("cookie已失效!");
return false;
}
//var maskMobile = BaseRegex.GetStringJson(ref data, "maskOwnerMobile");
//if (!shopLoginInfo.LoginName.EndsWith(maskMobile))
if (!data.Contains(shopLoginInfo.ShopAccount))
{
BaseMsgForm.ShowError("cookie与国际版店铺不匹配,请核对店铺!");
return false;
}
List<ShopLoginInfo> serverShopLst = new List<ShopLoginInfo>();
var rst = AdminShopListForm.AdminGetServerShopLstForSetCookie(shopLoginInfo, serverShopLst);
if (rst != "success")
{
BaseMsgForm.ShowError(rst);
return false;
}
//如果店铺没有cookie登录过,处理店铺第一次登录(分裂cookie下的所有店铺)
GetShopFirstLogin(data, serverShopLst);
if (updateFrom == SetCookieFromEnum.normal_user) // 普通用户更新本地店铺
{
var localShop = GlobalConfig.ShopLoginList.Where(v => v.LoginName == shopLoginInfo.LoginName).ToList();
foreach (var sc in localShop)
{
sc.Cookies2 = cookie2;
sc.LoginStatus2 = "国际版在线";
}
}
shopLoginInfo.Cookies2 = cookie2;
shopLoginInfo.LoginStatus2 = "国际版在线";
ShopListForm.UpdateServerShopCookies(shopLoginInfo); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie
return true;
}
/// <summary>