1优化cookie登录检测逻辑 2调整标题重组逻辑不再强制前缀 3库存上传、选品上传显示提交时间 4备货管理使用双接口处理
This commit is contained in:
1 parent
c203c161a2
commit
7ea35b6866
22 files changed
+479
-490
No files matched your search
@@ -136,7 +136,7 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
}
|
||||
|
||||
List<ShopLoginInfo> serverShopLst = new List<ShopLoginInfo>();
|
||||
var rst = AdminGetServerShopListForSetCookie(shopLoginInfo, serverShopLst);
|
||||
var rst = AdminShopListForm.AdminGetServerShopLstForSetCookie(shopLoginInfo, serverShopLst);
|
||||
|
||||
if (rst != "success")
|
||||
{
|
||||
@@ -211,7 +211,7 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
}
|
||||
|
||||
List<ShopLoginInfo> serverShopLst = new List<ShopLoginInfo>();
|
||||
var rst = AdminGetServerShopListForSetCookie(shopLoginInfo, serverShopLst);
|
||||
var rst = AdminShopListForm.AdminGetServerShopLstForSetCookie(shopLoginInfo, serverShopLst);
|
||||
|
||||
if (rst != "success")
|
||||
{
|
||||
@@ -290,67 +290,13 @@ namespace TemuKJD.KJDForms.ShopForms
|
||||
if (oldServerShop == null)
|
||||
{
|
||||
if (updateFrom != SetCookieFromEnum.normal_user)
|
||||
AdminShopForm.AdminAddServerShop(newShop); // 店铺写入到服务端
|
||||
AdminShopListForm.AdminAddServerShop(newShop); // 店铺写入到服务端
|
||||
else
|
||||
ShopListForm.AddServerDouShop(newShop); // 店铺写入到服务端
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string AdminGetServerShopListForSetCookie(ShopLoginInfo loginShop, List<ShopLoginInfo> lstRst)
|
||||
{
|
||||
if (lstRst == null)
|
||||
lstRst = new List<ShopLoginInfo>();
|
||||
|
||||
var url = BaseClass.BuildObjString("shop/admin_get_shop_list");
|
||||
var data = UserLogin.GetSignaturex() +
|
||||
"&search_user_name=" + loginShop.UserName +
|
||||
"&search_login_name=" + loginShop.LoginName;
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html)
|
||||
|| !html.Contains("shop_id") || !html.Contains("shop_account") || !html.Contains("login_pass"))
|
||||
{
|
||||
return "获取失败:" + BaseRegex.GetStringJson(ref html, "msg");
|
||||
}
|
||||
|
||||
var jArr = JObject.Parse(html)["data"];
|
||||
if (jArr.Count() == 0)
|
||||
return "获取失败:未获取到data数据";
|
||||
|
||||
foreach (JObject jObj in jArr)
|
||||
{
|
||||
string shopStr = jObj.ToString();
|
||||
ShopLoginInfo shop = new ShopLoginInfo();
|
||||
shop.DbId = BaseRegex.GetStringJson(ref shopStr, "id");
|
||||
if (shop.DbId == null)
|
||||
continue;
|
||||
|
||||
shop.LoginName = BaseRegex.GetStringJson(ref shopStr, "login_name");
|
||||
shop.Password = BaseRegex.GetStringJson(ref shopStr, "login_pass");
|
||||
shop.ShopId = BaseRegex.GetStringJson(ref shopStr, "shop_id");
|
||||
shop.ShopAccount = BaseRegex.GetStringJson(ref shopStr, "shop_account");
|
||||
shop.UserName = BaseRegex.GetStringJson(ref shopStr, "user_name");
|
||||
shop.SubUserName = BaseRegex.GetStringJson(ref shopStr, "sub_user_name");
|
||||
shop.GroupName = BaseRegex.GetStringJson(ref shopStr, "shop_group");
|
||||
shop.Cookies = BaseRegex.GetStringJson(ref shopStr, "cookie");
|
||||
shop.Cookies = shop.Cookies.Replace("&", "&").Replace("%", "%").Replace("+", "+");
|
||||
shop.Cookies2 = BaseRegex.GetStringJson(ref shopStr, "cookie2");
|
||||
shop.Cookies2 = shop.Cookies2.Replace("&", "&").Replace("%", "%").Replace("+", "+");
|
||||
shop.CompanyName = BaseRegex.GetStringJson(ref shopStr, "company_name");
|
||||
shop.Notes = BaseRegex.GetStringJson(ref shopStr, "notes");
|
||||
shop.LoginStatus = BaseRegex.GetStringJson(ref shopStr, "login_status");
|
||||
shop.LoginStatus2 = BaseRegex.GetStringJson(ref shopStr, "login_status2");
|
||||
shop.OperateSubSaName = BaseRegex.GetStringJson(ref shopStr, "operate_sub_sa_name");
|
||||
|
||||
lstRst.Add(shop);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
private void btnGetCookie_Click(object sender, EventArgs e)
|
||||
{
|
||||
//复制cookie
|
||||
|
||||
Reference in new issue
Block a user