| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using dodohold.core;
- using Sayaka.Common;
- namespace molilian.core
- {
- public partial class JdUnionPlus
- {
- public async Task<string> H5stHack(dynamic querystring, CancellationToken cancellationToken)
- {
- string body = string.Empty;
- string useragent = _account.user_agent;
- if (string.IsNullOrEmpty(useragent)) useragent = ProviderFakeUserAgent.RandomComputer;
- var args = new
- {
- version = _config.jd_h5st_sign_version,
- body = querystring,
- pin = _account.pin,
- ua = _account.user_agent,
- h5st = _account.h5st,
- };
- try
- {
- string data = args.Convert2Json();
- string url = _config.jd_h5st_sign_url;
- if (string.IsNullOrEmpty(url)) url = "http://localhost:3001/h5st";
- #if DEBUG
- url = "http://bjapi.molilian.com:3001/h5st";
- #endif
- WebClientUtility client = new WebClientUtility();
- client.SetContentType("application/json");
- client.Timeout = TimeSpan.FromMicroseconds(2000);
- client.Post(data);
- var response = await client.RequestAsync(url, "POST", cancellationToken);
- body = response.Body();
- var root = body.Convert2JsonElement();
- int code = root.Read<int>("code");
- string qs = root.PathRead<string>("body.qs");
- if (code == 200)
- {
- return qs;
- }
- _ = new LoggerLibrary("JdUnion", "h5st").Info(body).SaveAsync();
- }
- catch (Exception ex)
- {
- _ = new LoggerLibrary("JdUnion", "h5st_error")
- .Info(body)
- .Info(ex.Message, ex.StackTrace)
- .SaveAsync();
- }
- return string.Empty;
- }
- }
- }
|