1更新cef版本到138 2其他一些小改动
This commit is contained in:
1 parent
800ccb857d
commit
c5be88568c
161 files changed
+1670
-6757
No files matched your search
@@ -3,7 +3,7 @@ using AllBase.Helper;
|
||||
using AllBase.Model.Result;
|
||||
using CefSharp;
|
||||
using CefSharp.WinForms;
|
||||
using TemuKJD.DashBoardForms;
|
||||
//using TemuKJD.DashBoardForms;
|
||||
using TemuKJD.Helper;
|
||||
using TemuKJD.KJDForms.BaseForms;
|
||||
using Microsoft.Win32;
|
||||
@@ -20,13 +20,11 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Hosting;
|
||||
using System.Windows.Forms;
|
||||
using Work;
|
||||
using Work.BLL.Tools;
|
||||
using TemuKJD.KJDForms.ShopForms;
|
||||
using TemuKJD.KJDForms.ToolForms;
|
||||
|
||||
namespace TemuKJD.KJDForms.AdminForms
|
||||
{
|
||||
public partial class AdminShopLoginForm : LRBaseForm
|
||||
@@ -122,7 +120,8 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
continue;
|
||||
|
||||
string cookies = "";
|
||||
List<Cookie> cookieList = CEFBrowser.GetCookieList(shopCookieHead, cefWebBrowser.RequestContext.GetCookieManager(null));
|
||||
//List<Cookie> cookieList = CEFBrowser.GetCookieList(shopCookieHead, cefWebBrowser.RequestContext.GetCookieManager(null)); // cef138
|
||||
List<Cookie> cookieList = CEFBrowser.GetCookieList(shopCookieHead, cefWebBrowser.GetCookieManager(null));
|
||||
var keys = new string[] { "a42", "_bee", "_f77", "_nano_fp", "api_uid", "rckk", "ru1k", "ru2k", "SUB_PASS_ID" };
|
||||
|
||||
if (cookieList != null && cookieList.Count > 0)
|
||||
@@ -209,7 +208,8 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
else
|
||||
{
|
||||
var cookie2 = shop.Cookies2;
|
||||
var t = CEFBrowser.SetCookieAsync(shopCookieHead2, cookie2, cefWebBrowser.RequestContext.GetCookieManager(null));
|
||||
//var t = CEFBrowser.SetCookieAsync(shopCookieHead2, cookie2, cefWebBrowser.RequestContext.GetCookieManager(null)); // cef138
|
||||
var t = CEFBrowser.SetCookieAsync(shopCookieHead2, cookie2, cefWebBrowser.GetCookieManager(null));
|
||||
t.Wait(5000);
|
||||
cefWebBrowser.Load("https://agentseller.temu.com");
|
||||
}
|
||||
@@ -228,7 +228,8 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
continue;
|
||||
|
||||
string cookies2 = "";
|
||||
List<Cookie> cookieList2 = CEFBrowser.GetCookieList(shopCookieHead2, cefWebBrowser.RequestContext.GetCookieManager(null));
|
||||
//List<Cookie> cookieList2 = CEFBrowser.GetCookieList(shopCookieHead2, cefWebBrowser.RequestContext.GetCookieManager(null));
|
||||
List<Cookie> cookieList2 = CEFBrowser.GetCookieList(shopCookieHead2, cefWebBrowser.GetCookieManager(null)); // cef138
|
||||
if (cookieList2 != null && cookieList2.Count > 0)
|
||||
{
|
||||
for(int i =0; i < cookieList2.Count; i++)
|
||||
@@ -355,16 +356,26 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
/// </summary>
|
||||
private void AutoLogin()
|
||||
{
|
||||
if (InvokeRequired)
|
||||
{
|
||||
}
|
||||
if (shop == null)
|
||||
return;
|
||||
|
||||
if (cefWebBrowser == null)
|
||||
{
|
||||
//cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser("about:blank", false);
|
||||
var setting = new CefSettings();
|
||||
if (Cef.IsInitialized != true)
|
||||
{
|
||||
var rst = Cef.InitializeAsync(setting);
|
||||
rst.Wait();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(InitUrl))
|
||||
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(InitUrl, false);
|
||||
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(InitUrl, true);
|
||||
else
|
||||
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(shopMainUrl, false);
|
||||
cefWebBrowser = CEFBrowser.CreateChromiumWebBrowser(shopMainUrl, true);
|
||||
CustomResourceRequestHandlerLocal resourceRequestHandler = new CustomResourceRequestHandlerLocal();
|
||||
resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete;
|
||||
cefWebBrowser.RequestHandler = new CustomRequestHandler(resourceRequestHandler);
|
||||
@@ -401,21 +412,26 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
var t = CEFBrowser.SetCookieAsync(shopCookieHead, cookie, cefWebBrowser.RequestContext.GetCookieManager(null));
|
||||
t.Wait(5000);
|
||||
|
||||
if (this.openType != EnumOpenType.login)
|
||||
{
|
||||
var cookie2 = shop.Cookies2;
|
||||
var t2 = CEFBrowser.SetCookieAsync(shopCookieHead2, cookie2, cefWebBrowser.RequestContext.GetCookieManager(null));
|
||||
t2.Wait(5000);
|
||||
}
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
splitContainer1.Panel1.Controls.Add(cefWebBrowser);
|
||||
//cefWebBrowser.Load(shopMainUrl);
|
||||
}));
|
||||
while (!cefWebBrowser.IsBrowserInitialized || !cefWebBrowser.GetBrowser().MainFrame.IsValid)
|
||||
Thread.Sleep(20);
|
||||
CEFBrowser.DeleteCookie(cefWebBrowser.GetCookieManager(null));
|
||||
|
||||
//var t = CEFBrowser.SetCookieAsync(shopCookieHead, cookie, cefWebBrowser.RequestContext.GetCookieManager(null)); // cef138
|
||||
var t = CEFBrowser.SetCookieAsync(shopCookieHead, cookie, cefWebBrowser.GetCookieManager(null));
|
||||
t.Wait(5000);
|
||||
|
||||
if (this.openType != EnumOpenType.login)
|
||||
{
|
||||
var cookie2 = shop.Cookies2;
|
||||
//var t2 = CEFBrowser.SetCookieAsync(shopCookieHead2, cookie2, cefWebBrowser.RequestContext.GetCookieManager(null));
|
||||
var t2 = CEFBrowser.SetCookieAsync(shopCookieHead2, cookie2, cefWebBrowser.GetCookieManager(null)); // cef138
|
||||
t2.Wait(5000);
|
||||
}
|
||||
|
||||
//根据登录的具体店铺设置local storage
|
||||
if (!string.IsNullOrEmpty(shop.ShopId))
|
||||
@@ -483,7 +499,8 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
{
|
||||
if (lifeHandler.parent != null)
|
||||
{
|
||||
var cookies = CEFBrowser.GetCookieList("", lifeHandler.parent.RequestContext.GetCookieManager(null));
|
||||
//var cookies = CEFBrowser.GetCookieList("", lifeHandler.parent.RequestContext.GetCookieManager(null)); // cef138
|
||||
var cookies = CEFBrowser.GetCookieList("", lifeHandler.parent.GetCookieManager(null));
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
CefForm cefForm = new CefForm(targetUrl, cookies);
|
||||
|
||||
Reference in new issue
Block a user