店铺登录逻辑处理
This commit is contained in:
1 parent
311971ca21
commit
89eb9ce9d4
8 files changed
+139
-75
No files matched your search
@@ -193,4 +193,14 @@ namespace AllBase.Model.Result
|
|||||||
public string brand_reg_num { get; set; }
|
public string brand_reg_num { get; set; }
|
||||||
public long id { get; set; }
|
public long id { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// temu 一个登录账号下可以有多个店铺
|
||||||
|
public class ShopCompany
|
||||||
|
{
|
||||||
|
public string UserName { get; set; }
|
||||||
|
public string LoginName { get; set; }
|
||||||
|
public string AccountId { get; set; }
|
||||||
|
public string AccountName { get; set; }
|
||||||
|
public string LoginStatus { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -114,7 +114,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
{
|
{
|
||||||
//shop.ApiAuthStatus = "授权成功";
|
//shop.ApiAuthStatus = "授权成功";
|
||||||
ShopListForm.UpdateShopTokens(GlobalConfig.DouShopLoginList.Where(s => s.ShopAccount == shop.ShopAccount).ToList());
|
ShopListForm.UpdateShopTokens(GlobalConfig.DouShopLoginList.Where(s => s.ShopAccount == shop.ShopAccount).ToList());
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
OnSaveComplete(shop);
|
OnSaveComplete(shop);
|
||||||
if (this.Created && this.chkCloseAfterLogin.Checked)
|
if (this.Created && this.chkCloseAfterLogin.Checked)
|
||||||
{
|
{
|
||||||
@@ -134,7 +134,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
if (this.Created && this.chkCloseAfterLogin.Checked)
|
if (this.Created && this.chkCloseAfterLogin.Checked)
|
||||||
{
|
{
|
||||||
ShopListForm.UpdateShopTokens(GlobalConfig.DouShopLoginList.Where(s => s.ShopAccount == shop.ShopAccount).ToList());
|
ShopListForm.UpdateShopTokens(GlobalConfig.DouShopLoginList.Where(s => s.ShopAccount == shop.ShopAccount).ToList());
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
OnSaveComplete(shop);
|
OnSaveComplete(shop);
|
||||||
Thread.Sleep(2000);
|
Thread.Sleep(2000);
|
||||||
Invoke(new Action(() => { this.Close(); }));
|
Invoke(new Action(() => { this.Close(); }));
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
+ "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password)
|
+ "&login_pass=" + GetHtml.UrlEncodeUtf8(_shop.Password)
|
||||||
+ "&shop_id=" + _shop.ShopAccountId
|
+ "&shop_id=" + _shop.ShopAccountId
|
||||||
+ "&shop_account=" + _shop.ShopAccount
|
+ "&shop_account=" + _shop.ShopAccount
|
||||||
|
+ "&cookie=" + _shop.Cookies
|
||||||
+ "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.Group);
|
+ "&shop_group=" + GetHtml.UrlEncodeUtf8(_shop.Group);
|
||||||
|
|
||||||
var result = GetHtml.PostUtf8(url, data);
|
var result = GetHtml.PostUtf8(url, data);
|
||||||
@@ -218,14 +219,12 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
/// <param name="shopName">店铺名称</param>
|
/// <param name="shopName">店铺名称</param>
|
||||||
/// <param name="shopCookies">cookies</param>
|
/// <param name="shopCookies">cookies</param>
|
||||||
/// <param name="fromTool">工具名称(可不填写)</param>
|
/// <param name="fromTool">工具名称(可不填写)</param>
|
||||||
public static void AddServerShopCookies(DouShopLoginInfo shop, string shopCookies, string fromTool = null)
|
public static void UpdateServerShopCookies(DouShopLoginInfo shop, string shopCookies, string fromTool = null)
|
||||||
{
|
{
|
||||||
var fTool = string.IsNullOrEmpty(fromTool) ? "" : "&from_tool=" + fromTool;
|
var fTool = string.IsNullOrEmpty(fromTool) ? "" : "&from_tool=" + fromTool;
|
||||||
var url = BaseClass.BuildObjString("shop/mdy_shop");
|
var url = BaseClass.BuildObjString("shop/mdy_shop");
|
||||||
var data = UserLogin.GetSignaturex()
|
var data = UserLogin.GetSignaturex()
|
||||||
+ "&login_name=" + shop.LoginName
|
+ "&login_name=" + shop.LoginName
|
||||||
+ "&shop_id=" + shop.ShopAccountId
|
|
||||||
+ "&shop_account=" + shop.ShopAccount
|
|
||||||
+ "&cookie=" + shopCookies.Replace("&", "&").Replace("%", "%").Replace("+", "+")
|
+ "&cookie=" + shopCookies.Replace("&", "&").Replace("%", "%").Replace("+", "+")
|
||||||
+ fTool;
|
+ fTool;
|
||||||
var result = GetHtml.PostUtf8(url, data);
|
var result = GetHtml.PostUtf8(url, data);
|
||||||
@@ -236,17 +235,17 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
BaseMsgForm.ShowError("服务端登录状态保存失败!请检查网络连接。");
|
BaseMsgForm.ShowError("服务端登录状态保存失败!请检查网络连接。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 获取店铺Cookies
|
///// 获取店铺Cookies
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <param name="shopNames">店铺名称,逗号隔开</param>
|
///// <param name="shopNames">店铺名称,逗号隔开</param>
|
||||||
public static string GetServerShopCookies(string shopNames)
|
//public static string GetServerShopCookies(string shopNames)
|
||||||
{
|
//{
|
||||||
var url = BaseClass.BuildObjString("shop&act=get_shop_cookie");
|
// var url = BaseClass.BuildObjString("shop&act=get_shop_cookie");
|
||||||
var data = UserLogin.GetSignaturex() + "&shop_name=" + shopNames.Trim(',');
|
// var data = UserLogin.GetSignaturex() + "&shop_name=" + shopNames.Trim(',');
|
||||||
var result = GetHtml.PostUtf8(url, data);
|
// var result = GetHtml.PostUtf8(url, data);
|
||||||
return result;
|
// return result;
|
||||||
}
|
//}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public static string GetServerShopTokens(string shopLoginNames)
|
public static string GetServerShopTokens(string shopLoginNames)
|
||||||
@@ -280,13 +279,21 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
{
|
{
|
||||||
if ((isAdd as bool?) == true)
|
if ((isAdd as bool?) == true)
|
||||||
{
|
{
|
||||||
ShopLoginForm shopLoginForm = new ShopLoginForm(shopInfo);
|
var shop = GlobalConfig.DouShopLoginList.FirstOrDefault(v => v.LoginName == shopInfo.LoginName);
|
||||||
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
if (shop != null)
|
||||||
shopLoginForm.Show();
|
{
|
||||||
|
BaseMsgForm.ShowError("店铺" + shopInfo.LoginName + "已存在!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GlobalConfig.DouShopLoginList.Add(shopInfo);
|
||||||
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
|
ShopListForm.AddServerDouShop(shopInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
ShopListForm.AddServerDouShop(shopInfo);
|
ShopListForm.AddServerDouShop(shopInfo);
|
||||||
shopLoginForm_SaveComplete(shopInfo);
|
shopLoginForm_SaveComplete(shopInfo);
|
||||||
}
|
}
|
||||||
@@ -356,7 +363,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
GlobalConfig.DouShopLoginList.Add(shop);
|
GlobalConfig.DouShopLoginList.Add(shop);
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
ShopListForm.AddServerDouShop(shop);
|
ShopListForm.AddServerDouShop(shop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -423,7 +430,9 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
return;
|
return;
|
||||||
this.Invoke(new Action(() =>
|
this.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
DataGridViewRow dgvr = dgvShop.Rows.Cast<DataGridViewRow>().Where(p => p.Cells.GetCellValueFromColumnName("colLoginName").ParseToString() == param.LoginName).FirstOrDefault();
|
DataGridViewRow dgvr = dgvShop.Rows.Cast<DataGridViewRow>().Where(p =>
|
||||||
|
p.Cells.GetCellValueFromColumnName("colLoginName").ParseToString() == param.LoginName &&
|
||||||
|
p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == param.ShopAccountId).FirstOrDefault();
|
||||||
if (dgvr != null)
|
if (dgvr != null)
|
||||||
{
|
{
|
||||||
UpdateDataGridViewRowToken(dgvr, param);
|
UpdateDataGridViewRowToken(dgvr, param);
|
||||||
@@ -603,7 +612,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
if (!string.IsNullOrEmpty(loginResult))
|
if (!string.IsNullOrEmpty(loginResult))
|
||||||
shop.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd");
|
shop.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd");
|
||||||
|
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
AddDataGridViewRow(shop);
|
AddDataGridViewRow(shop);
|
||||||
}
|
}
|
||||||
if (this.Created && isShowProgress)
|
if (this.Created && isShowProgress)
|
||||||
@@ -737,7 +746,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
return;
|
return;
|
||||||
DeleteShop(e.RowIndex);
|
DeleteShop(e.RowIndex);
|
||||||
DelServerDouShop(shop.LoginName);
|
DelServerDouShop(shop.LoginName);
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
break;
|
break;
|
||||||
case "编辑":
|
case "编辑":
|
||||||
ShopAddEditForm editForm = new ShopAddEditForm(shop);
|
ShopAddEditForm editForm = new ShopAddEditForm(shop);
|
||||||
@@ -788,8 +797,12 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
private void DeleteShop(int rowIndex)
|
private void DeleteShop(int rowIndex)
|
||||||
{
|
{
|
||||||
string shopLoginName = this.dgvShop.Rows[rowIndex].Cells["colLoginName"].Value.ParseToString();
|
string shopLoginName = this.dgvShop.Rows[rowIndex].Cells["colLoginName"].Value.ParseToString();
|
||||||
dgvShop.Rows.RemoveAt(rowIndex);
|
List<DataGridViewRow> dgvRows = dgvShop.Rows.Cast<DataGridViewRow>().Where(p =>
|
||||||
GlobalConfig.DouShopLoginList.RemoveAll(v => v.ShopAccount == shopLoginName);
|
p.Cells.GetCellValueFromColumnName("colLoginName").ParseToString() == shopLoginName).ToList();
|
||||||
|
|
||||||
|
foreach(var row in dgvRows)
|
||||||
|
dgvShop.Rows.Remove(row);
|
||||||
|
GlobalConfig.DouShopLoginList.RemoveAll(v => v.LoginName == shopLoginName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnCheck_Click(object sender, EventArgs e)
|
private void btnCheck_Click(object sender, EventArgs e)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using Microsoft.Win32;
|
|||||||
using NaiBa.CefHelper;
|
using NaiBa.CefHelper;
|
||||||
using NaiBa.CefHelper.Handler;
|
using NaiBa.CefHelper.Handler;
|
||||||
using NaiBa.Util.Extension;
|
using NaiBa.Util.Extension;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
@@ -42,6 +43,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
private string shopMainUrl = "https://seller.kuajingmaihuo.com";
|
private string shopMainUrl = "https://seller.kuajingmaihuo.com";
|
||||||
private ChromiumWebBrowser cefWebBrowser = null;
|
private ChromiumWebBrowser cefWebBrowser = null;
|
||||||
private DouShopLoginInfo shop = null;
|
private DouShopLoginInfo shop = null;
|
||||||
|
private List<ShopCompany> lstShopCompany = new List<ShopCompany>();
|
||||||
private string currentUrl = "";
|
private string currentUrl = "";
|
||||||
|
|
||||||
public ShopLoginForm(DouShopLoginInfo shopInfo)
|
public ShopLoginForm(DouShopLoginInfo shopInfo)
|
||||||
@@ -109,17 +111,10 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
if (openType!= EnumOpenType.login)
|
if (openType!= EnumOpenType.login)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(shop.ShopAccountId) || string.IsNullOrEmpty(shop.ShopAccount))
|
if (!lstShopCompany.Any(c => c.LoginName == shop.LoginName))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
//var jsStr = "function getShopName() { return document.getElementsByClassName('headerShopName')[0].innerHTML; } getShopName();";
|
|
||||||
//var response = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
|
|
||||||
//response.Wait(5000);
|
|
||||||
//var res = response.Result.Result?.ToString();
|
|
||||||
//if (res != null && res.Contains("</span>"))
|
|
||||||
{
|
{
|
||||||
//shop.ShopAccount = res.Substring(res.IndexOf("</span>") + 7);
|
|
||||||
//shop.ShopAccount = BaseRegex.FliterHtmlTag(shop.ShopAccount);
|
|
||||||
string cookies = "";
|
string cookies = "";
|
||||||
List<Cookie> cookieList = CEFBrowser.GetCookieList(shopCookieHead, cefWebBrowser.RequestContext.GetCookieManager(null));
|
List<Cookie> cookieList = CEFBrowser.GetCookieList(shopCookieHead, cefWebBrowser.RequestContext.GetCookieManager(null));
|
||||||
if (cookieList != null && cookieList.Count > 0)
|
if (cookieList != null && cookieList.Count > 0)
|
||||||
@@ -133,37 +128,69 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
}
|
}
|
||||||
cookies = cookies.Trim().TrimEnd(';');
|
cookies = cookies.Trim().TrimEnd(';');
|
||||||
}
|
}
|
||||||
shop.Cookies = cookies;
|
|
||||||
//if (isMultiLogin)
|
|
||||||
//{
|
|
||||||
// shop.DictMultiCookies[MultiLoginCookieName] = cookies;
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(shop.Cookies)
|
if (!string.IsNullOrEmpty(cookies)
|
||||||
&& !string.IsNullOrEmpty(shop.ShopAccount)
|
&& lstShopCompany.Any(c => c.LoginName == shop.LoginName))
|
||||||
&& !string.IsNullOrEmpty(shop.ShopAccountId)
|
|
||||||
//&& !string.IsNullOrEmpty(shop.Mobile)
|
|
||||||
//&& !string.IsNullOrEmpty(shop.ShopToken)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
shop.LoginStatus = "登录成功";
|
var lstShopCompanyCopy = lstShopCompany.ToList();
|
||||||
|
//var shopCompany = lstShopCompany.FirstOrDefault(c=>c.LoginName==shop.LoginName);
|
||||||
|
//if (shopCompany == null)
|
||||||
|
// shopCompany = new ShopCompany();
|
||||||
|
|
||||||
shop.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd");
|
//shop.LoginStatus = "登录成功";
|
||||||
var shopInfo = GlobalConfig.DouShopLoginList.FirstOrDefault(v => v.ShopAccountId == shop.ShopAccountId);
|
//shop.ShopAccountId = shopCompany.AccountId;
|
||||||
if (shopInfo != null)
|
//shop.ShopAccount = shopCompany.AccountName;
|
||||||
|
//shop.Cookies = cookies;
|
||||||
|
|
||||||
|
//shop.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd");
|
||||||
|
//var shopInfo = GlobalConfig.DouShopLoginList.FirstOrDefault(v => v.ShopAccountId == shop.ShopAccountId);
|
||||||
|
//if (shopInfo != null)
|
||||||
|
//{
|
||||||
|
// shopInfo.Cookies = shop.Cookies;
|
||||||
|
// shopInfo.Password = shop.Password;
|
||||||
|
// shopInfo.ShopAccountId = shop.ShopAccountId;
|
||||||
|
// shopInfo.ShopAccount = shop.ShopAccount;
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
// GlobalConfig.DouShopLoginList.Add(shop);
|
||||||
|
//StartUp.SaveLocalShopLoginInfo();
|
||||||
|
////ShopListForm.AddServerDouShop(shop); // 店铺写入到服务端
|
||||||
|
//ShopListForm.UpdateServerShopCookies(shop, shop.Cookies); // cookie写入到服务端
|
||||||
|
|
||||||
|
foreach (ShopCompany sc in lstShopCompanyCopy)
|
||||||
{
|
{
|
||||||
//shopInfo.ShopToken = shop.ShopToken;
|
DouShopLoginInfo newShop = new DouShopLoginInfo()
|
||||||
//shopInfo.Mobile = shop.Mobile;
|
{
|
||||||
shopInfo.Cookies = shop.Cookies;
|
LoginName = shop.LoginName,
|
||||||
shopInfo.Password = shop.Password;
|
Password = shop.Password,
|
||||||
shopInfo.ShopAccountId = shop.ShopAccountId;
|
Group = shop.Group,
|
||||||
shopInfo.ShopAccount = shop.ShopAccount;
|
LoginStatus = "登录成功",
|
||||||
|
ShopAccount = sc.AccountName,
|
||||||
|
ShopAccountId = sc.AccountId,
|
||||||
|
Cookies = cookies,
|
||||||
|
};
|
||||||
|
|
||||||
|
var oldShop = GlobalConfig.DouShopLoginList.FirstOrDefault(l =>
|
||||||
|
l.LoginName == newShop.LoginName && l.ShopAccountId == newShop.ShopAccountId);
|
||||||
|
if (oldShop == null)
|
||||||
|
{
|
||||||
|
GlobalConfig.DouShopLoginList.Add(newShop);
|
||||||
|
ShopListForm.AddServerDouShop(newShop); // 店铺写入到服务端
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
oldShop.LoginName = shop.LoginName;
|
||||||
|
oldShop.Password = shop.Password;
|
||||||
|
oldShop.Group = shop.Group;
|
||||||
|
oldShop.LoginStatus = "登录成功";
|
||||||
|
oldShop.ShopAccount = sc.AccountName;
|
||||||
|
oldShop.ShopAccountId = sc.AccountId;
|
||||||
|
oldShop.Cookies = cookies;
|
||||||
|
}
|
||||||
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
|
ShopListForm.UpdateServerShopCookies(newShop, newShop.Cookies);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
GlobalConfig.DouShopLoginList.Add(shop);
|
|
||||||
StartUp.SaveDouShopLoginInfo();
|
|
||||||
//ShopListForm.AddServerDouShop(shop); // 店铺写入到服务端
|
|
||||||
ShopListForm.AddServerShopCookies(shop, shop.Cookies); // cookie写入到服务端
|
|
||||||
OnSaveComplete(shop);
|
OnSaveComplete(shop);
|
||||||
if (this.Created && this.chkCloseAfterLogin.Checked)
|
if (this.Created && this.chkCloseAfterLogin.Checked)
|
||||||
{
|
{
|
||||||
@@ -359,10 +386,24 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
var maskMobile = BaseRegex.GetStringJson(ref data, "maskOwnerMobile");
|
var maskMobile = BaseRegex.GetStringJson(ref data, "maskOwnerMobile");
|
||||||
if (shop.LoginName.EndsWith(maskMobile))
|
if (shop.LoginName.EndsWith(maskMobile))
|
||||||
{
|
{
|
||||||
shop.ShopAccountId = BaseRegex.GetStringJson(ref data, "mallId");
|
lstShopCompany.Clear();
|
||||||
shop.ShopAccount = BaseRegex.GetStringJson(ref data, "mallName");
|
var jObj = JObject.Parse(data);
|
||||||
//shop.ShopToken = BaseRegex.GetStringJson(ref data, "token");
|
var jArr = jObj["result"]?["companyList"]?[0]?["malInfoList"] as JArray;
|
||||||
//shop.Mobile = BaseRegex.GetStringJson(ref data, "mobile");
|
if (jArr == null)
|
||||||
|
jArr = new JArray();
|
||||||
|
foreach (var productObj in jArr)
|
||||||
|
{
|
||||||
|
var prod = JsonHelper.SerializeObject(productObj);
|
||||||
|
ShopCompany sc = new ShopCompany()
|
||||||
|
{
|
||||||
|
AccountId = BaseRegex.GetStringJson(ref prod, "mallId"),
|
||||||
|
AccountName = BaseRegex.GetStringJson(ref prod, "mallName"),
|
||||||
|
LoginName = shop.LoginName,
|
||||||
|
UserName = BaseClass.UserName,
|
||||||
|
LoginStatus = "登录成功",
|
||||||
|
};
|
||||||
|
this.lstShopCompany.Add(sc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -716,7 +757,7 @@ function fireKeyEvent(el, evtType, keyCode) {
|
|||||||
if (shop != null)
|
if (shop != null)
|
||||||
{
|
{
|
||||||
shop.DictMultiCookies.Remove(cmbMultiCookieName.Text);
|
shop.DictMultiCookies.Remove(cmbMultiCookieName.Text);
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
|
|
||||||
InitMultiLoginCookies();
|
InitMultiLoginCookies();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -689,7 +689,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
|||||||
break;
|
break;
|
||||||
if (dyShop.LoginStatus == "未登录")
|
if (dyShop.LoginStatus == "未登录")
|
||||||
{
|
{
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
dyShop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.LoginStatus == "登录成功");
|
dyShop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.LoginStatus == "登录成功");
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
}
|
}
|
||||||
@@ -2075,7 +2075,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
|||||||
if (result.Contains("已过期"))
|
if (result.Contains("已过期"))
|
||||||
{
|
{
|
||||||
shop.ApiAuthStatus = "未授权";
|
shop.ApiAuthStatus = "未授权";
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2130,7 +2130,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
|||||||
BaseMsgForm.ShowInfo("获取类目失败!");
|
BaseMsgForm.ShowInfo("获取类目失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("cat_dy", list);
|
NaiBa.Util.Helper.ConfigHelper.SaveConfig("cat_dy", list);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@@ -2576,7 +2576,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
|||||||
while (propResult.Contains("已过期"))
|
while (propResult.Contains("已过期"))
|
||||||
{
|
{
|
||||||
dyShop.ApiAuthStatus = "未授权";
|
dyShop.ApiAuthStatus = "未授权";
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
dyShop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.ApiAuthStatus == "授权成功");
|
dyShop = GlobalConfig.DouShopLoginList.FirstOrDefault(s => s.ApiAuthStatus == "授权成功");
|
||||||
if (dyShop == null)
|
if (dyShop == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
|||||||
if (result.Contains("已过期"))
|
if (result.Contains("已过期"))
|
||||||
{
|
{
|
||||||
shop.ApiAuthStatus = "未授权";
|
shop.ApiAuthStatus = "未授权";
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
GoodsCategoryModel cat = new GoodsCategoryModel()
|
GoodsCategoryModel cat = new GoodsCategoryModel()
|
||||||
{
|
{
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
|||||||
Thread.Sleep(Randomx.GetId(50, 150));
|
Thread.Sleep(Randomx.GetId(50, 150));
|
||||||
}
|
}
|
||||||
if (shopList.Count() > 0)
|
if (shopList.Count() > 0)
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
Invoke(new Action(() =>
|
Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
if (isShowProgress)
|
if (isShowProgress)
|
||||||
@@ -1594,7 +1594,7 @@ namespace LittleRabbit.LittleRabbitForms.UploadForms
|
|||||||
if (shop.PayStatus != 1)
|
if (shop.PayStatus != 1)
|
||||||
{
|
{
|
||||||
shop.TrialOperateCount++;
|
shop.TrialOperateCount++;
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveLocalShopLoginInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -85,10 +85,10 @@ namespace LittleRabbit
|
|||||||
localDouShopList.AddRange(serverDouShopList);
|
localDouShopList.AddRange(serverDouShopList);
|
||||||
foreach (var localShop in localDouShopList)
|
foreach (var localShop in localDouShopList)
|
||||||
{
|
{
|
||||||
if (GlobalConfig.DouShopLoginList.Any(s => s.LoginName == localShop.LoginName))
|
if (GlobalConfig.DouShopLoginList.Any(s => s.LoginName == localShop.LoginName && s.ShopAccountId == localShop.ShopAccountId))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var serverShop = serverDouShopList.FirstOrDefault(s => s.LoginName == localShop.LoginName);
|
var serverShop = serverDouShopList.FirstOrDefault(s => s.LoginName == localShop.LoginName && s.ShopAccountId == localShop.ShopAccountId);
|
||||||
if (serverShop != null)
|
if (serverShop != null)
|
||||||
{
|
{
|
||||||
localShop.ShopAccount = serverShop.ShopAccount;
|
localShop.ShopAccount = serverShop.ShopAccount;
|
||||||
@@ -450,7 +450,7 @@ namespace LittleRabbit
|
|||||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("fission_setting_param", GlobalConfig.FissionSettingParam);
|
NaiBa.Util.Helper.ConfigHelper.SaveConfig("fission_setting_param", GlobalConfig.FissionSettingParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SaveDouShopLoginInfo()
|
public static void SaveLocalShopLoginInfo()
|
||||||
{
|
{
|
||||||
ConcurrentList<DouShopLoginInfo> shopLoginListCopy =
|
ConcurrentList<DouShopLoginInfo> shopLoginListCopy =
|
||||||
JsonHelper.DeserializeJsonToObject<ConcurrentList<DouShopLoginInfo>>(JsonHelper.SerializeObject(GlobalConfig.DouShopLoginList));
|
JsonHelper.DeserializeJsonToObject<ConcurrentList<DouShopLoginInfo>>(JsonHelper.SerializeObject(GlobalConfig.DouShopLoginList));
|
||||||
|
|||||||
Reference in new issue
Block a user