gx
This commit is contained in:
1 parent
c2dcedd238
commit
16cdd3d46e
34 files changed
+837
-481
No files matched your search
@@ -21,7 +21,7 @@ namespace Store.Client.Apis
|
||||
/// </summary>
|
||||
public DateTime GetServerTime()
|
||||
{
|
||||
HttpResult result = ServerRequest(new ServerHttpItem { URL = $"{_config.Host}/time.php" });
|
||||
HttpResult result = ServerRequest(new HttpItem { URL = $"{_config.Host}/time.php" });
|
||||
if (result.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
if (DateTime.TryParse(result.Html, out DateTime dt))
|
||||
@@ -42,7 +42,7 @@ namespace Store.Client.Apis
|
||||
/// </summary>
|
||||
public string GetAuthConfig()
|
||||
{
|
||||
ServerHttpItem item = new ServerHttpItem();
|
||||
HttpItem item = new HttpItem();
|
||||
item.URL = $"{_config.Host}?obj=api/config&act=auth_config";
|
||||
HttpResult result = ServerRequest(item);
|
||||
if (result.StatusCode == HttpStatusCode.OK)
|
||||
@@ -59,7 +59,7 @@ namespace Store.Client.Apis
|
||||
public string GetCacheServerRatio()
|
||||
{
|
||||
|
||||
ServerHttpItem item = new ServerHttpItem();
|
||||
HttpItem item = new HttpItem();
|
||||
item.URL = _config.Host + "?" + _config.ObjUrl + "config&act=cache_service_mode";
|
||||
item.Method = MethodType.Post;
|
||||
//item.SignUser();
|
||||
@@ -80,7 +80,7 @@ namespace Store.Client.Apis
|
||||
//public HttpResult GetImageCache(string imgUrl)
|
||||
//{
|
||||
// long id = MD5Helper.GetLong(imgUrl);
|
||||
// ServerHttpItem item = new ServerHttpItem();
|
||||
// HttpItem item = new HttpItem();
|
||||
// item.Method = MethodType.Post;
|
||||
// item.URL = _config.Host + "?" + _config.ObjUrl + "add_img";
|
||||
// item.Postdata = "act=get&table=" + Math.Abs(id % 1024) + "&id=" + id;
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
using MAX.Core.Extensions;
|
||||
using MAX.Core.Helpers;
|
||||
using Store.Client.Agent;
|
||||
using Store.Client.Commons;
|
||||
using Store.Client.Extensions;
|
||||
using Store.Client.HttpExtension;
|
||||
using Store.Framework;
|
||||
using Store.Framework.Tools;
|
||||
@@ -26,7 +24,7 @@ namespace Store.Client.Apis
|
||||
{
|
||||
_logger.Info("123");
|
||||
int r2 = RandomHelper.GetRandomNumber(100000000, 899999999); //生成随机码
|
||||
ServerHttpItem item = new ServerHttpItem();
|
||||
HttpItem item = new HttpItem();
|
||||
item.URL = base.BuildServiceUrl("user/user_login");
|
||||
item.Method = MethodType.Post;
|
||||
Dictionary<string, string> param = new Dictionary<string, string>
|
||||
@@ -44,14 +42,13 @@ namespace Store.Client.Apis
|
||||
//{ "client_addr", _client.Address }
|
||||
};
|
||||
item.Postdata = param.ToUrlParams();
|
||||
item.Sign();
|
||||
HttpResult result = ServerRequest(item);
|
||||
if (result.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
string chCode = Regex.Match(result.Html, "<c>([^<]+)</c>")?.Groups[1]?.Value ?? "";
|
||||
if (!string.IsNullOrEmpty(chCode))
|
||||
{
|
||||
string codex = SignTool.Encryption(r2);
|
||||
string codex = Encryption(r2);
|
||||
if (chCode != codex)
|
||||
{
|
||||
result.StatusCode = HttpStatusCode.Unauthorized;
|
||||
|
||||
Reference in new issue
Block a user