同上一条

This commit is contained in:
wule committed 2026-01-17 11:22:10 +08:00
1 parent c05c7e4f23
commit 6ce238ca01
2 files changed
+20 -10

No files matched your search

+1 -1
View File
@@ -39,7 +39,7 @@ namespace TemuKJD
pnlExtend.Visible = BaseClass.DarenYaoyue;
//直接登录上货工具
if (BaseClass.MainPath != "weixin1")
if (BaseClass.MainPath != "weixin")
{
label1.Visible = true;
pnlChat.Visible = pnlUploadGoods.Visible = false;
+19 -9
View File
@@ -58,6 +58,8 @@ namespace TemuKJD.WXForms.TalkForms
public WxTalkForm()
{
InitializeComponent();
ChatConfig.LoadChatSetting();
}
private void WxTalkForm_FormClosed(object sender, FormClosedEventArgs e)
@@ -183,10 +185,18 @@ namespace TemuKJD.WXForms.TalkForms
// 设置cef cookie
if (shop.Chat != null && shop.Chat.IsBrowserInitialized)
{
var cookieManager = shop.Chat.GetCookieManager(null);
var cookieManager = shop.Chat.RequestContext.GetCookieManager(null);
var cookieLst = JsonHelper.DeserializeJsonToList<CefSharp.Cookie>(shop.Cookies.ParseToString());
if (cookieLst == null)
cookieLst = new List<Cookie>();
cookieManager.DeleteCookies("qq.com", null);
CEFBrowser.SetCookieAsync("jinritemai.com", shop.Cookies, shop.Chat.GetCookieManager(null));
foreach (var cook in cookieLst)
{
var t = CEFBrowser.SetCookieAsync(cook.Domain, cook.Name + "=" + cook.Value + ";", cookieManager);
t.Wait(5000);
}
if (shop.LoginStatus == "登录成功")
shop.Chat.Load("https://store.weixin.qq.com/shop/kf");
@@ -209,7 +219,7 @@ namespace TemuKJD.WXForms.TalkForms
result.ShopAccount = shop.ShopAccount;
result.LoginStatus = shop.LoginStatus;
var r = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(x => x.Cells["columnShopId"].Value.ToString() == shop.ShopId);
var r = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(x => x.Cells["colShopId"].Value.ToString() == shop.ShopId);
this.Invoke(new Action(() =>
{
int iGrid = 0;
@@ -218,9 +228,9 @@ namespace TemuKJD.WXForms.TalkForms
else
iGrid = r.Index;
dgvShop.Rows[iGrid].Cells["ColumnShopID"].Value = shop.ShopId; // 店铺ID
dgvShop.Rows[iGrid].Cells["ColumnShopName"].Value = shop.ShopAccount; // 店铺名称
dgvShop.Rows[iGrid].Cells["ColumnShopStatus"].Value = shop.LoginStatus == "未登录" ? "未登录 点击登录" : shop.LoginStatus; // 登录状态
dgvShop.Rows[iGrid].Cells["colShopId"].Value = shop.ShopId; // 店铺ID
dgvShop.Rows[iGrid].Cells["colShopName"].Value = shop.ShopAccount; // 店铺名称
dgvShop.Rows[iGrid].Cells["colLoginStatus"].Value = shop.LoginStatus == "登录成功" ? "在线" : "掉线"; // 登录状态
dicRowColor[dgvShop.Rows[iGrid]] = dgvShop.Rows[iGrid].DefaultCellStyle.BackColor;
if (shop.Chat == null)
@@ -288,7 +298,7 @@ namespace TemuKJD.WXForms.TalkForms
{
if (lifeHandler.parent != null)
{
var cookies = CEFBrowser.GetCookieList("", lifeHandler.parent.GetCookieManager(null));
var cookies = CEFBrowser.GetCookieList("", lifeHandler.parent.RequestContext.GetCookieManager(null));
Invoke(new Action(() =>
{
CefForm cefForm = new CefForm(targetUrl, cookies);
@@ -330,7 +340,7 @@ namespace TemuKJD.WXForms.TalkForms
//}
//if (lifeHandler.parent != null)
//{
// var cookies = CEFBrowser.GetCookieList("", lifeHandler.parent.GetCookieManager(null));
// var cookies = CEFBrowser.GetCookieList("", lifeHandler.parent.RequestContext.GetCookieManager(null));
// Invoke(new Action(() =>
// {
// CefForm cefForm = new CefForm(targetUrl, cookies);
@@ -354,7 +364,7 @@ namespace TemuKJD.WXForms.TalkForms
if (cookieLst == null)
cookieLst = new List<Cookie>();
var cookieManager = mainWebBrowser.GetCookieManager(null);
var cookieManager = mainWebBrowser.RequestContext.GetCookieManager(null);
cookieManager.DeleteCookiesAsync("qq.com", null).Wait();
foreach (var cook in cookieLst)
{