|
@@ -390,36 +390,65 @@ namespace molilian.api.Controllers
|
|
|
[HttpGet]
|
|
[HttpGet]
|
|
|
public async Task<ActionResult> dplist([FromQuery] string query = "", [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
|
|
public async Task<ActionResult> dplist([FromQuery] string query = "", [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
|
|
+ var clientIp = _accessor.HttpContext.GetUserIp();
|
|
|
//验证签名
|
|
//验证签名
|
|
|
if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
|
|
if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
|
|
|
{
|
|
{
|
|
|
|
|
+ _ = new LoggerLibrary("api", "dplist_error")
|
|
|
|
|
+ .Info($"{clientIp}\t{query}")
|
|
|
|
|
+ .Info($"{a}\t{sign}\t{t}")
|
|
|
|
|
+ .Info("验证错误")
|
|
|
|
|
+ .SaveAsync();
|
|
|
|
|
+
|
|
|
return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
|
|
return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
DateTime time1 = t.Convert2Datetime();
|
|
DateTime time1 = t.Convert2Datetime();
|
|
|
if (time1 < DateTime.Now.AddMinutes(-10))
|
|
if (time1 < DateTime.Now.AddMinutes(-10))
|
|
|
{
|
|
{
|
|
|
|
|
+ _ = new LoggerLibrary("api", "dplist_error")
|
|
|
|
|
+ .Info($"{clientIp}\t{query}")
|
|
|
|
|
+ .Info($"{a}\t{sign}\t{t}")
|
|
|
|
|
+ .Info("验证错误2")
|
|
|
|
|
+ .SaveAsync();
|
|
|
return new APIResult(new { success = false, message = "验证错误2" }, APIResultCodeEnum.Unauthorized);
|
|
return new APIResult(new { success = false, message = "验证错误2" }, APIResultCodeEnum.Unauthorized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var account = await ApiAccountCore.GetOneAsync(a);
|
|
var account = await ApiAccountCore.GetOneAsync(a);
|
|
|
if (account == null)
|
|
if (account == null)
|
|
|
{
|
|
{
|
|
|
|
|
+ _ = new LoggerLibrary("api", "dplist_error")
|
|
|
|
|
+ .Info($"{clientIp}\t{query}")
|
|
|
|
|
+ .Info($"{a}\t{sign}\t{t}")
|
|
|
|
|
+ .Info("验证错误3")
|
|
|
|
|
+ .SaveAsync();
|
|
|
|
|
+
|
|
|
return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
|
|
return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
|
|
|
}
|
|
}
|
|
|
string app_sign = $"{account.api_secret}@{t}".MD5();
|
|
string app_sign = $"{account.api_secret}@{t}".MD5();
|
|
|
if (sign != app_sign)
|
|
if (sign != app_sign)
|
|
|
{
|
|
{
|
|
|
|
|
+ _ = new LoggerLibrary("api", "dplist_error")
|
|
|
|
|
+ .Info($"{clientIp}\t{query}")
|
|
|
|
|
+ .Info($"{a}\t{sign}\t{t}")
|
|
|
|
|
+ .Info("验证错误4")
|
|
|
|
|
+ .SaveAsync();
|
|
|
|
|
+
|
|
|
return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
|
|
return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(query))
|
|
if (string.IsNullOrEmpty(query))
|
|
|
{
|
|
{
|
|
|
|
|
+ _ = new LoggerLibrary("api", "dplist_error")
|
|
|
|
|
+ .Info($"{clientIp}\t{query}")
|
|
|
|
|
+ .Info($"{a}\t{sign}\t{t}")
|
|
|
|
|
+ .Info("查询条件不能为空")
|
|
|
|
|
+ .SaveAsync();
|
|
|
|
|
+
|
|
|
return new APIResult(new { success = false, message = "查询条件不能为空" });
|
|
return new APIResult(new { success = false, message = "查询条件不能为空" });
|
|
|
}
|
|
}
|
|
|
- int[] report_account_ids = account.report_account_ids.ToArray<int>(',');
|
|
|
|
|
- int[] report_exclude_account_ids = account.report_exclude_account_ids.ToArray<int>(',');
|
|
|
|
|
|
|
+ int[] report_account_ids = account.report_account_ids.TryToArray<int>(',');
|
|
|
|
|
+ int[] report_exclude_account_ids = account.report_exclude_account_ids.TryToArray<int>(',');
|
|
|
|
|
|
|
|
string filter = $"batchId=@query";
|
|
string filter = $"batchId=@query";
|
|
|
var account_list = await TkPoolCore.ListAsync();
|
|
var account_list = await TkPoolCore.ListAsync();
|
|
@@ -454,13 +483,13 @@ namespace molilian.api.Controllers
|
|
|
{
|
|
{
|
|
|
list.Add(new { pid = item.accountId, url = item.deeplinkUrl, item.shortLinkUrl, count = item.click_num, time = item.exp_time });
|
|
list.Add(new { pid = item.accountId, url = item.deeplinkUrl, item.shortLinkUrl, count = item.click_num, time = item.exp_time });
|
|
|
}
|
|
}
|
|
|
- var clientIp = _accessor.HttpContext.GetUserIp();
|
|
|
|
|
- LoggerLibrary log = new LoggerLibrary("api", "dplist");
|
|
|
|
|
- log.Info($"{clientIp}\t{query}\tcount:{list.Count}");
|
|
|
|
|
|
|
|
|
|
var ids = data.Select(e => e.Id).ToArray();
|
|
var ids = data.Select(e => e.Id).ToArray();
|
|
|
- log.Info(string.Join(',', ids));
|
|
|
|
|
- _ = log.SaveAsync();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ _ = new LoggerLibrary("api", "dplist")
|
|
|
|
|
+ .Info($"{clientIp}\t{query}\tcount:{list.Count}")
|
|
|
|
|
+ .Info(string.Join(',', ids))
|
|
|
|
|
+ .SaveAsync();
|
|
|
|
|
|
|
|
var update = new DBContext.Table("tk_order_tracking")
|
|
var update = new DBContext.Table("tk_order_tracking")
|
|
|
.Add("last_pull_time", DateTime.Now)
|
|
.Add("last_pull_time", DateTime.Now)
|
|
@@ -578,7 +607,7 @@ namespace molilian.api.Controllers
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var account = await ApiAccountCore.GetOneAsync(a);
|
|
var account = await ApiAccountCore.GetOneAsync(a);
|
|
|
- if (account == null || !account.enable_report)
|
|
|
|
|
|
|
+ if (account == null)
|
|
|
{
|
|
{
|
|
|
_ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\t", $"message:验证错误3")
|
|
_ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\t", $"message:验证错误3")
|
|
|
.Info(form.GetRawText())
|
|
.Info(form.GetRawText())
|