防止内置的fiddler核心自己导致软件闪退。
This commit is contained in:
1 parent
e25cc1b51e
commit
61264a5a99
3 files changed
+38
-8
No files matched your search
@@ -27,9 +27,11 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
ShopLoginInfo shop = null;
|
||||
SetCookieFromEnum updateFrom;
|
||||
public FddlHelper fddlHelper = new FddlHelper();
|
||||
public static PDDShopUpdateFddlCookieForm instance;
|
||||
|
||||
public PDDShopUpdateFddlCookieForm(ShopLoginInfo _shop, SetCookieFromEnum from = SetCookieFromEnum.normal_user)
|
||||
{
|
||||
instance = this;
|
||||
InitializeComponent();
|
||||
shop = _shop;
|
||||
updateFrom = from;
|
||||
@@ -101,7 +103,18 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
return;
|
||||
}
|
||||
|
||||
FiddlerApplication.BeforeRequest -= FiddlerApplication_BeforeRequest;
|
||||
|
||||
if (this.Created && !this.Disposing && !this.IsDisposed)
|
||||
{
|
||||
// 窗口存在
|
||||
}
|
||||
else
|
||||
{
|
||||
// 窗口关闭
|
||||
return;
|
||||
}
|
||||
|
||||
FiddlerApplication.BeforeRequest -= FiddlerApplication_BeforeRequest;
|
||||
|
||||
string JSESSIONID = BaseRegex.GetStringCookie(ref headerCookie, "JSESSIONID").ParseToString().Trim('\'', '\n', '\r');
|
||||
string _nano_fp = BaseRegex.GetStringCookie(ref headerCookie, "_nano_fp").ParseToString().Trim('\'', '\n', '\r');
|
||||
@@ -170,6 +183,14 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
|
||||
var data = "";
|
||||
data = PDDShopListForm.GetShopStatus(cookieShop);
|
||||
if (data.Contains("基础连接已关闭"))
|
||||
{
|
||||
data = PDDShopListForm.GetShopStatus(cookieShop);
|
||||
}
|
||||
if (data.Contains("基础连接已关闭"))
|
||||
{
|
||||
data = PDDShopListForm.GetShopStatus(cookieShop);
|
||||
}
|
||||
if (!data.Contains("\"success\":true") || data.Contains("会话已过期"))
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
@@ -252,16 +273,18 @@ namespace TemuKJD.PDDForms.ShopForms
|
||||
|
||||
PDDShopListForm.UpdateServerShopCookies(shop); // 店铺cookie写入服务端,不同账号下的同名店铺一起更新cookie
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
this.OnSaveComplete(shop);
|
||||
this.Close();
|
||||
}));
|
||||
if (this.Created && !this.Disposing && !this.IsDisposed)
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
this.OnSaveComplete(shop);
|
||||
this.Close();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
private void PDDShopUpdateFddlCookieForm_FormClosed(object sender, FormClosedEventArgs e)
|
||||
{
|
||||
fddlHelper.UninstallFiddler();
|
||||
}
|
||||
|
||||
private void PDDShopUpdateFddlCookieForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
|
||||
Reference in new issue
Block a user