From af26c32c7387e4bfaaa57f7cfe86298be2cecec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=88=E6=A3=AE=E5=90=B4?= <8402134@qq.com> Date: Wed, 26 Oct 2022 23:01:01 +0800 Subject: [PATCH] 1. --- 类库/Api.Framework/Cps/PinduoduoApi.cs | 1 + 类库/Api.Framework/Cps/douyin_form_login.cs | 8 ++++++++ 类库/Api.Framework/CpsClient.cs | 8 ++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/类库/Api.Framework/Cps/PinduoduoApi.cs b/类库/Api.Framework/Cps/PinduoduoApi.cs index ce5ac59..6de2458 100644 --- a/类库/Api.Framework/Cps/PinduoduoApi.cs +++ b/类库/Api.Framework/Cps/PinduoduoApi.cs @@ -167,6 +167,7 @@ namespace Api.Framework.Cps //Member.online = false; //ApiClient.GetSession().SaveOrUpdate(Member); Member.is_valid = false; + ApiClient.GetSession().SaveOrUpdate(Member); EventClient.OnEvent(this, $@"拼多多异常:{this.Member.username}({this.Member.usernick}),{ex.Message} - {ex.StackTrace} ,注:请重新登录拼多多,{api}"); throw new Exception($"{this.Member.username}({this.Member.usernick}),{ex.Message},注:请重新登录拼多多"); diff --git a/类库/Api.Framework/Cps/douyin_form_login.cs b/类库/Api.Framework/Cps/douyin_form_login.cs index 345b37e..88de60c 100644 --- a/类库/Api.Framework/Cps/douyin_form_login.cs +++ b/类库/Api.Framework/Cps/douyin_form_login.cs @@ -61,6 +61,9 @@ namespace Api.Framework.Cps engine.Options.CachePath = HttpExtend.MapPath($"Cache\\Cookies\\{accountName}"); webControl1.WebView.Engine = engine; + this.webView1.CertificateError += WebView1_CertificateError; + + EO.Base.Runtime.EnableEOWP = true; EO.Base.Runtime.Exception += Runtime_Exception; webControl1.WebView.LoadUrl(loginUrl); @@ -72,6 +75,11 @@ namespace Api.Framework.Cps webControl1.WebView.RegisterResourceHandler(sHandler);//注册自定义资源处理程序 } + private void WebView1_CertificateError(object sender, CertificateErrorEventArgs e) + { + e.Continue(); + } + /// /// 是否跳转到授权页面 /// diff --git a/类库/Api.Framework/CpsClient.cs b/类库/Api.Framework/CpsClient.cs index dd2dfd1..587e651 100644 --- a/类库/Api.Framework/CpsClient.cs +++ b/类库/Api.Framework/CpsClient.cs @@ -368,10 +368,14 @@ namespace Api.Framework internal static string _key { get; set; } internal static int _appid { get; set; } - internal static string _host { get; set; } + internal static string _host + { + get { return ApiClient.Setting.SystemConfig.cps_server_api; } + //set; + } internal static void SetEnckey(int appid, string host, string key) { - _host = host; + //_host = host; _appid = appid; _key = key; }