Merge branch 'master' of github.com:KJD2025/KJD
This commit is contained in:
commit
8eb6a1cc0b
10 files changed
+307
-81
No files matched your search
@@ -104,8 +104,8 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<LangVersion>12.0</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<LangVersion>12.0</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
|
||||
</PropertyGroup>
|
||||
@@ -191,6 +191,7 @@
|
||||
<Compile Include="Model\Config\WxShopKfStatistics.cs" />
|
||||
<Compile Include="Model\Config\WxShopMainStatistics.cs" />
|
||||
<Compile Include="Model\Config\WxShopUploadInfo.cs" />
|
||||
<Compile Include="Model\Data\ProductLatestOutAmountInfo.cs" />
|
||||
<Compile Include="Model\Data\WXBuyUrlNotesInfo.cs" />
|
||||
<Compile Include="Model\Data\WXOrderDecryptAddressInfo.cs" />
|
||||
<Compile Include="Model\DBModel\oem.cs" />
|
||||
|
||||
+83
-7
@@ -1250,13 +1250,89 @@ Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrom
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// post 数据
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="byteData"></param>
|
||||
/// <returns></returns>
|
||||
public static string PostUtf8(string url, byte[] byteData)
|
||||
public static async Task<string> PostUtf8Async(string url, string postData, string contentType = "", int? timeOut = null)
|
||||
{
|
||||
|
||||
bool isError = false;
|
||||
string[] l = UserAgent.Split('\n');
|
||||
reTry:
|
||||
try
|
||||
{
|
||||
string codeType = "utf-8";
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
|
||||
request.UserAgent = l[new Random(Guid.NewGuid().GetHashCode()).Next(l.Length)].Trim();
|
||||
byte[] byteData = Encoding.GetEncoding(codeType).GetBytes(postData);
|
||||
request.Method = "POST";
|
||||
request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
|
||||
request.Timeout = BaseClass.TimeOut * 1000;
|
||||
request.ReadWriteTimeout = BaseClass.TimeOut * 1000;
|
||||
if (timeOut != null)
|
||||
{
|
||||
request.Timeout = timeOut.Value * 1000;
|
||||
request.ReadWriteTimeout = timeOut.Value * 1000;
|
||||
}
|
||||
request.Proxy = null;
|
||||
request.ContentType = "application/x-www-form-urlencoded; charset=" + codeType;
|
||||
//if(BaseClass.SaLevel > 0)
|
||||
{
|
||||
//260306 采用GZip/deflate压缩
|
||||
//request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate, br, zstd");
|
||||
request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
|
||||
}
|
||||
if (url.StartsWith("https://openapi.jinritemai.com/"))
|
||||
{
|
||||
request.Headers.Add("X-USE-BOE", "1");
|
||||
request.Headers.Add("Origin-From", "djt_prod");
|
||||
request.Headers.Add("djt_prod", "boe_time_sku");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(contentType))
|
||||
{
|
||||
request.ContentType = contentType;
|
||||
}
|
||||
request.ContentLength = byteData.Length;
|
||||
request.Referer = url;
|
||||
request.CookieContainer = new CookieContainer();
|
||||
request.AllowAutoRedirect = false;
|
||||
using (Stream requestStream = await request.GetRequestStreamAsync())
|
||||
{
|
||||
requestStream.Write(byteData, 0, byteData.Length);
|
||||
}
|
||||
HttpWebResponse response = (HttpWebResponse) await request.GetResponseAsync();
|
||||
|
||||
Stream receiveStream = response.GetResponseStream();
|
||||
StreamReader readStream = new StreamReader(receiveStream, Encoding.GetEncoding(codeType));
|
||||
|
||||
//if (BaseClass.SaLevel == 0)
|
||||
//{
|
||||
// return readStream.ReadToEnd().Trim();
|
||||
//}
|
||||
//else
|
||||
{
|
||||
//260306 超管采用GZip/deflate压缩
|
||||
//Thread.Sleep(50);
|
||||
return GetProxyHtml.ReadResponse(response);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogSave.Add(e.ToString());
|
||||
//if (!isError)
|
||||
//{
|
||||
// isError = true;
|
||||
// goto reTry;
|
||||
//}
|
||||
Thread.Sleep(50);
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// post 数据
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="byteData"></param>
|
||||
/// <returns></returns>
|
||||
public static string PostUtf8(string url, byte[] byteData)
|
||||
{
|
||||
WebClientx webClient = new WebClientx();
|
||||
try
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Model.Data
|
||||
{
|
||||
public class ProductLatestOutAmountInfo
|
||||
{
|
||||
public string order_id { get; set; } // 3739003536152355584
|
||||
|
||||
public string out_product_id { get; set; } // EC1960398929745-15938489009A
|
||||
public string out_sku_id { get; set; } // BSEC18052272175281198712A
|
||||
public int sku_cnt { get; set; } // 1
|
||||
|
||||
/// <summary>
|
||||
/// 外采金额,单位分
|
||||
/// </summary>
|
||||
public int out_amount { get; set; } // 1129
|
||||
|
||||
public string shop_id { get; set; } // 1960967267443629494
|
||||
public string product_id { get; set; } // 10001456670425
|
||||
public string sku_id { get; set; } // 26988803933
|
||||
public string sku_code { get; set; } // BSEC18052272175281198712A
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user