店铺账号cookie保存功能
This commit is contained in:
1 parent
4aaf264e89
commit
311971ca21
4 files changed
+122
-83
No files matched your search
+3
-1
@@ -3,4 +3,6 @@
|
|||||||
Bin
|
Bin
|
||||||
NotUse
|
NotUse
|
||||||
obj
|
obj
|
||||||
.psd
|
.psd
|
||||||
|
packages
|
||||||
|
.user
|
||||||
@@ -89,7 +89,7 @@ namespace AllBase
|
|||||||
|
|
||||||
public static string OriginUrl = "http://mobile.yangkeduo.com";
|
public static string OriginUrl = "http://mobile.yangkeduo.com";
|
||||||
public static string NewUrl = "https://yangkeduo.com";
|
public static string NewUrl = "https://yangkeduo.com";
|
||||||
public static string ServerUrl = "http://localhost:8000";
|
public static string ServerUrl = "http://localhost:9000";
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单监控延迟
|
/// 订单监控延迟
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -142,7 +142,7 @@ namespace AllBase
|
|||||||
/// 图片API
|
/// 图片API
|
||||||
/// </summary>
|
/// </summary>
|
||||||
//public static string LoginApiUrl = "http://new.qixiaoke.com/";
|
//public static string LoginApiUrl = "http://new.qixiaoke.com/";
|
||||||
public static string LoginApiUrl = "http://localhost:8000";
|
public static string LoginApiUrl = "http://localhost:9000";
|
||||||
public static string BigDataApiUrl = "http://bigdata.qixiaoke.com/";
|
public static string BigDataApiUrl = "http://bigdata.qixiaoke.com/";
|
||||||
public static string GateApi = "";
|
public static string GateApi = "";
|
||||||
public static string QqGroupNum = "";
|
public static string QqGroupNum = "";
|
||||||
|
|||||||
@@ -218,12 +218,14 @@ 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 AddServerDouShopCookies(string shopName, string shopCookies, string fromTool = null)
|
public static void AddServerShopCookies(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&act=add_shop_cookie");
|
var url = BaseClass.BuildObjString("shop/mdy_shop");
|
||||||
var data = UserLogin.GetSignaturex()
|
var data = UserLogin.GetSignaturex()
|
||||||
+ "&shop_name=" + shopName
|
+ "&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);
|
||||||
@@ -517,18 +519,18 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
if (shop != null)
|
if (shop != null)
|
||||||
{
|
{
|
||||||
retryLogin:
|
retryLogin:
|
||||||
var loginResult = GetShopStatus(shop);
|
var loginResult = "\"code\":0";//GetShopStatus(shop);
|
||||||
if (loginResult.Contains("\"code\":0"))
|
if (loginResult.Contains("\"code\":0"))
|
||||||
{
|
{
|
||||||
shop.LoginStatus = "登录成功";
|
shop.LoginStatus = "登录成功";
|
||||||
var shopId = BaseRegex.GetStringJson(ref loginResult, "id");
|
//var shopId = BaseRegex.GetStringJson(ref loginResult, "id");
|
||||||
var shopToken = BaseRegex.GetStringJson(ref loginResult, "token");
|
//var shopToken = BaseRegex.GetStringJson(ref loginResult, "token");
|
||||||
var shopName = BaseRegex.GetStringJson(ref loginResult, "shop_name");
|
//var shopName = BaseRegex.GetStringJson(ref loginResult, "shop_name");
|
||||||
var mobile = BaseRegex.GetStringJson(ref loginResult, "mobile");
|
//var mobile = BaseRegex.GetStringJson(ref loginResult, "mobile");
|
||||||
if (!string.IsNullOrEmpty(shopId)) shop.ShopAccountId = shopId;
|
//if (!string.IsNullOrEmpty(shopId)) shop.ShopAccountId = shopId;
|
||||||
if (!string.IsNullOrEmpty(shopToken)) shop.ShopToken = shopToken;
|
//if (!string.IsNullOrEmpty(shopToken)) shop.ShopToken = shopToken;
|
||||||
if (!string.IsNullOrEmpty(shopName)) shop.ShopAccount = shopName;
|
//if (!string.IsNullOrEmpty(shopName)) shop.ShopAccount = shopName;
|
||||||
if (!string.IsNullOrEmpty(mobile)) shop.Mobile = mobile;
|
//if (!string.IsNullOrEmpty(mobile)) shop.Mobile = mobile;
|
||||||
}
|
}
|
||||||
else if (loginResult.Contains("未登录"))
|
else if (loginResult.Contains("未登录"))
|
||||||
{
|
{
|
||||||
@@ -720,7 +722,15 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
switch (headerText)
|
switch (headerText)
|
||||||
{
|
{
|
||||||
case "检测":
|
case "检测":
|
||||||
CheckShopLoginAsync(new string[] { loginName });
|
//CheckShopLoginAsync(new string[] { loginName });
|
||||||
|
IsOperate = true;
|
||||||
|
{
|
||||||
|
ShopLoginForm shopLoginForm = new ShopLoginForm(shop);
|
||||||
|
shopLoginForm.openType = EnumOpenType.manage;
|
||||||
|
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
||||||
|
shopLoginForm.ShowDialog();
|
||||||
|
IsOperate = false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "删除":
|
case "删除":
|
||||||
if (BaseMsgForm.ShowConfirm("确定删除店铺吗?删除后不可恢复!").DialogResult == DialogResult.Cancel)
|
if (BaseMsgForm.ShowConfirm("确定删除店铺吗?删除后不可恢复!").DialogResult == DialogResult.Cancel)
|
||||||
@@ -736,37 +746,40 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
break;
|
break;
|
||||||
case "登录":
|
case "登录":
|
||||||
IsOperate = true;
|
IsOperate = true;
|
||||||
ShopLoginForm shopLoginForm = new ShopLoginForm(shop);
|
{
|
||||||
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
ShopLoginForm shopLoginForm = new ShopLoginForm(shop);
|
||||||
shopLoginForm.ShowDialog();
|
shopLoginForm.openType = EnumOpenType.login;
|
||||||
IsOperate = false;
|
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
||||||
break;
|
shopLoginForm.ShowDialog();
|
||||||
case "多重登录":
|
}
|
||||||
IsOperate = true;
|
|
||||||
ShopLoginForm shopMultiLoginForm = new ShopLoginForm(shop);
|
|
||||||
shopMultiLoginForm.isMultiLogin = true;
|
|
||||||
shopMultiLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
|
||||||
shopMultiLoginForm.ShowDialog();
|
|
||||||
IsOperate = false;
|
|
||||||
break;
|
|
||||||
case "接口授权":
|
|
||||||
case "上货授权":
|
|
||||||
IsOperate = true;
|
|
||||||
//GetHtml.OpenUrl("https://fuwu.jinritemai.com/authorize?service_id=815");
|
|
||||||
ShopAuthForm shopAuthForm = new ShopAuthForm(shop);
|
|
||||||
shopAuthForm.SaveComplete += shopLoginForm_SaveComplete;
|
|
||||||
shopAuthForm.ShowDialog();
|
|
||||||
IsOperate = false;
|
|
||||||
break;
|
|
||||||
case "拍单授权":
|
|
||||||
IsOperate = true;
|
|
||||||
//GetHtml.OpenUrl("https://fuwu.jinritemai.com/detail?from=fuwu_market_orderDetail&service_id=20896");
|
|
||||||
ShopAuthForm shopAuthForm1 = new ShopAuthForm(shop);
|
|
||||||
shopAuthForm1.shopAuthUrl = "https://fuwu.jinritemai.com/authorize?service_id=20896";
|
|
||||||
shopAuthForm1.SaveComplete += shopLoginForm_SaveComplete;
|
|
||||||
shopAuthForm1.ShowDialog();
|
|
||||||
IsOperate = false;
|
IsOperate = false;
|
||||||
break;
|
break;
|
||||||
|
//case "多重登录":
|
||||||
|
// IsOperate = true;
|
||||||
|
// ShopLoginForm shopMultiLoginForm = new ShopLoginForm(shop);
|
||||||
|
// shopMultiLoginForm.isMultiLogin = true;
|
||||||
|
// shopMultiLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
||||||
|
// shopMultiLoginForm.ShowDialog();
|
||||||
|
// IsOperate = false;
|
||||||
|
// break;
|
||||||
|
//case "接口授权":
|
||||||
|
//case "上货授权":
|
||||||
|
// IsOperate = true;
|
||||||
|
// //GetHtml.OpenUrl("https://fuwu.jinritemai.com/authorize?service_id=815");
|
||||||
|
// ShopAuthForm shopAuthForm = new ShopAuthForm(shop);
|
||||||
|
// shopAuthForm.SaveComplete += shopLoginForm_SaveComplete;
|
||||||
|
// shopAuthForm.ShowDialog();
|
||||||
|
// IsOperate = false;
|
||||||
|
// break;
|
||||||
|
//case "拍单授权":
|
||||||
|
// IsOperate = true;
|
||||||
|
// //GetHtml.OpenUrl("https://fuwu.jinritemai.com/detail?from=fuwu_market_orderDetail&service_id=20896");
|
||||||
|
// ShopAuthForm shopAuthForm1 = new ShopAuthForm(shop);
|
||||||
|
// shopAuthForm1.shopAuthUrl = "https://fuwu.jinritemai.com/authorize?service_id=20896";
|
||||||
|
// shopAuthForm1.SaveComplete += shopLoginForm_SaveComplete;
|
||||||
|
// shopAuthForm1.ShowDialog();
|
||||||
|
// IsOperate = false;
|
||||||
|
// break;
|
||||||
default:
|
default:
|
||||||
dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value;
|
dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value;
|
||||||
break;
|
break;
|
||||||
@@ -830,6 +843,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
if (shopInfo != null && !string.IsNullOrEmpty(shopInfo.LoginName) && !string.IsNullOrEmpty(shopInfo.Password))
|
if (shopInfo != null && !string.IsNullOrEmpty(shopInfo.LoginName) && !string.IsNullOrEmpty(shopInfo.Password))
|
||||||
{
|
{
|
||||||
ShopLoginForm shopLoginForm = new ShopLoginForm(shopInfo);
|
ShopLoginForm shopLoginForm = new ShopLoginForm(shopInfo);
|
||||||
|
shopLoginForm.openType = EnumOpenType.login;
|
||||||
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
|
||||||
shopLoginForm.ShowDialog();
|
shopLoginForm.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,9 +26,15 @@ using Work.BLL.Tools;
|
|||||||
|
|
||||||
namespace LittleRabbit.LittleRabbitForms.ShopForms
|
namespace LittleRabbit.LittleRabbitForms.ShopForms
|
||||||
{
|
{
|
||||||
|
public enum EnumOpenType
|
||||||
|
{
|
||||||
|
login,
|
||||||
|
manage,
|
||||||
|
}
|
||||||
public partial class ShopLoginForm : LRBaseForm
|
public partial class ShopLoginForm : LRBaseForm
|
||||||
{
|
{
|
||||||
public int CloseAfterSecond { get; set; }
|
public int CloseAfterSecond { get; set; }
|
||||||
|
public EnumOpenType openType = EnumOpenType.manage;
|
||||||
public bool isMultiLogin = false;
|
public bool isMultiLogin = false;
|
||||||
public string MultiLoginCookieName = "";
|
public string MultiLoginCookieName = "";
|
||||||
private string shopCookieHead = "kuajingmaihuo.com";
|
private string shopCookieHead = "kuajingmaihuo.com";
|
||||||
@@ -51,6 +57,12 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
{
|
{
|
||||||
//this.splitContainer1.SplitterDistance = 674;
|
//this.splitContainer1.SplitterDistance = 674;
|
||||||
|
|
||||||
|
if (openType == EnumOpenType.login)
|
||||||
|
{
|
||||||
|
this.shop.ShopAccountId = "";
|
||||||
|
this.shop.ShopAccount = "";
|
||||||
|
}
|
||||||
|
|
||||||
if (isMultiLogin && shop != null)
|
if (isMultiLogin && shop != null)
|
||||||
{
|
{
|
||||||
this.pnlMultiLogin.Visible = true;
|
this.pnlMultiLogin.Visible = true;
|
||||||
@@ -87,25 +99,27 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
while (this.Created)
|
while (this.Created)
|
||||||
{
|
{
|
||||||
Thread.Sleep(3000);
|
Thread.Sleep(3000);
|
||||||
if (this.shop != null && currentUrl == shopMainUrl)
|
//continue;
|
||||||
|
|
||||||
|
if (this.shop != null && currentUrl.TrimEnd('/') == shopMainUrl)
|
||||||
{
|
{
|
||||||
if (!cefWebBrowser.GetBrowser().MainFrame.IsValid)
|
if (!cefWebBrowser.GetBrowser().MainFrame.IsValid)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
continue;
|
if (openType!= EnumOpenType.login)
|
||||||
|
continue;
|
||||||
|
|
||||||
var jsStr = "function getShopName() { return document.getElementsByClassName('headerShopName')[0].innerHTML; } getShopName();";
|
if (string.IsNullOrEmpty(shop.ShopAccountId) || string.IsNullOrEmpty(shop.ShopAccount))
|
||||||
var response = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
|
continue;
|
||||||
response.Wait(5000);
|
|
||||||
var res = response.Result.Result?.ToString();
|
//var jsStr = "function getShopName() { return document.getElementsByClassName('headerShopName')[0].innerHTML; } getShopName();";
|
||||||
if (res != null && res.Contains("</span>"))
|
//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 = res.Substring(res.IndexOf("</span>") + 7);
|
||||||
shop.ShopAccount = BaseRegex.FliterHtmlTag(shop.ShopAccount);
|
//shop.ShopAccount = BaseRegex.FliterHtmlTag(shop.ShopAccount);
|
||||||
//if (shop.ShopName.Contains("<span class="))
|
|
||||||
// shop.ShopName = shop.ShopName.Substring(shop.ShopName.IndexOf(">") + 1);
|
|
||||||
//if (shop.ShopName.Contains("</span>"))
|
|
||||||
// shop.ShopName = shop.ShopName.Substring(0, shop.ShopName.IndexOf("</span>"));
|
|
||||||
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)
|
||||||
@@ -120,16 +134,17 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
cookies = cookies.Trim().TrimEnd(';');
|
cookies = cookies.Trim().TrimEnd(';');
|
||||||
}
|
}
|
||||||
shop.Cookies = cookies;
|
shop.Cookies = cookies;
|
||||||
if (isMultiLogin)
|
//if (isMultiLogin)
|
||||||
{
|
//{
|
||||||
shop.DictMultiCookies[MultiLoginCookieName] = cookies;
|
// shop.DictMultiCookies[MultiLoginCookieName] = cookies;
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(shop.Cookies)
|
if (!string.IsNullOrEmpty(shop.Cookies)
|
||||||
&& !string.IsNullOrEmpty(shop.ShopAccount)
|
&& !string.IsNullOrEmpty(shop.ShopAccount)
|
||||||
&& !string.IsNullOrEmpty(shop.ShopAccountId)
|
&& !string.IsNullOrEmpty(shop.ShopAccountId)
|
||||||
//&& !string.IsNullOrEmpty(shop.Mobile)
|
//&& !string.IsNullOrEmpty(shop.Mobile)
|
||||||
&& !string.IsNullOrEmpty(shop.ShopToken))
|
//&& !string.IsNullOrEmpty(shop.ShopToken)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
shop.LoginStatus = "登录成功";
|
shop.LoginStatus = "登录成功";
|
||||||
|
|
||||||
@@ -137,16 +152,18 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
var shopInfo = GlobalConfig.DouShopLoginList.FirstOrDefault(v => v.ShopAccountId == shop.ShopAccountId);
|
var shopInfo = GlobalConfig.DouShopLoginList.FirstOrDefault(v => v.ShopAccountId == shop.ShopAccountId);
|
||||||
if (shopInfo != null)
|
if (shopInfo != null)
|
||||||
{
|
{
|
||||||
shopInfo.ShopToken = shop.ShopToken;
|
//shopInfo.ShopToken = shop.ShopToken;
|
||||||
shopInfo.Mobile = shop.Mobile;
|
//shopInfo.Mobile = shop.Mobile;
|
||||||
shopInfo.Cookies = shop.Cookies;
|
shopInfo.Cookies = shop.Cookies;
|
||||||
shopInfo.Password = shop.Password;
|
shopInfo.Password = shop.Password;
|
||||||
|
shopInfo.ShopAccountId = shop.ShopAccountId;
|
||||||
|
shopInfo.ShopAccount = shop.ShopAccount;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
GlobalConfig.DouShopLoginList.Add(shop);
|
GlobalConfig.DouShopLoginList.Add(shop);
|
||||||
StartUp.SaveDouShopLoginInfo();
|
StartUp.SaveDouShopLoginInfo();
|
||||||
//ShopListForm.AddServerDouShop(shop); // 店铺写入到服务端
|
//ShopListForm.AddServerDouShop(shop); // 店铺写入到服务端
|
||||||
ShopListForm.AddServerDouShopCookies(shop.ShopAccount, shop.Cookies); // cookie写入到服务端
|
ShopListForm.AddServerShopCookies(shop, shop.Cookies); // cookie写入到服务端
|
||||||
OnSaveComplete(shop);
|
OnSaveComplete(shop);
|
||||||
if (this.Created && this.chkCloseAfterLogin.Checked)
|
if (this.Created && this.chkCloseAfterLogin.Checked)
|
||||||
{
|
{
|
||||||
@@ -232,7 +249,7 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
|
|
||||||
if (cefWebBrowser == null)
|
if (cefWebBrowser == null)
|
||||||
{
|
{
|
||||||
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(shopMainUrl, false);
|
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser("about:blank", false);
|
||||||
CustomResourceRequestHandlerLocal resourceRequestHandler = new CustomResourceRequestHandlerLocal();
|
CustomResourceRequestHandlerLocal resourceRequestHandler = new CustomResourceRequestHandlerLocal();
|
||||||
resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete;
|
resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete;
|
||||||
cefWebBrowser.RequestHandler = new CustomRequestHandler(resourceRequestHandler);
|
cefWebBrowser.RequestHandler = new CustomRequestHandler(resourceRequestHandler);
|
||||||
@@ -252,32 +269,38 @@ namespace LittleRabbit.LittleRabbitForms.ShopForms
|
|||||||
cookie = shop.DictMultiCookies.Keys.Contains(MultiLoginCookieName) ? shop.DictMultiCookies[MultiLoginCookieName] : "";
|
cookie = shop.DictMultiCookies.Keys.Contains(MultiLoginCookieName) ? shop.DictMultiCookies[MultiLoginCookieName] : "";
|
||||||
|
|
||||||
var t = CEFBrowser.SetCookieAsync(shopCookieHead, cookie, cefWebBrowser.RequestContext.GetCookieManager(null));
|
var t = CEFBrowser.SetCookieAsync(shopCookieHead, cookie, cefWebBrowser.RequestContext.GetCookieManager(null));
|
||||||
|
|
||||||
splitContainer1.Panel1.Controls.Add(cefWebBrowser);
|
splitContainer1.Panel1.Controls.Add(cefWebBrowser);
|
||||||
|
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
|
Thread.Sleep(20);
|
||||||
|
cefWebBrowser.Load(shopMainUrl);
|
||||||
|
|
||||||
|
if (openType != EnumOpenType.login)
|
||||||
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < 50; i++)
|
for (int i = 0; i < 50; i++)
|
||||||
{
|
{
|
||||||
Thread.Sleep(100);
|
Thread.Sleep(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GlobalConfig.dicLocalStorage != null)
|
//设置 local storage
|
||||||
{
|
//if (GlobalConfig.dicLocalStorage != null)
|
||||||
Thread.Sleep(500);
|
//{
|
||||||
string jsCode = "function setStorage() {";
|
// Thread.Sleep(500);
|
||||||
foreach (var item in GlobalConfig.dicLocalStorage)
|
// string jsCode = "function setStorage() {";
|
||||||
{
|
// foreach (var item in GlobalConfig.dicLocalStorage)
|
||||||
if (item.Key == "$TCC_CONFIG" || item.Key == "$TCC_CONFIG_operate_config" || item.Key == "menuStyleStr")
|
// {
|
||||||
continue;
|
// if (item.Key == "$TCC_CONFIG" || item.Key == "$TCC_CONFIG_operate_config" || item.Key == "menuStyleStr")
|
||||||
|
// continue;
|
||||||
|
|
||||||
jsCode += "window.localStorage.setItem('" + item.Key + "', '" + item.Value + "');\r\n";
|
// jsCode += "window.localStorage.setItem('" + item.Key + "', '" + item.Value + "');\r\n";
|
||||||
}
|
// }
|
||||||
jsCode += "}";
|
// jsCode += "}";
|
||||||
jsCode += "setStorage();";
|
// jsCode += "setStorage();";
|
||||||
if (cefWebBrowser.GetBrowser().MainFrame.IsValid)
|
// if (cefWebBrowser.GetBrowser().MainFrame.IsValid)
|
||||||
cefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(jsCode);
|
// cefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(jsCode);
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (!this.Created)
|
if (!this.Created)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in new issue
Block a user