TkController.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. using molilian.core;
  2. using dodohold.core;
  3. using Microsoft.AspNetCore.Mvc;
  4. using System.Text.Json;
  5. using TencentCloud.Ecm.V20190719.Models;
  6. using YunhuiKit;
  7. namespace molilian.api.Controllers
  8. {
  9. [ApiController]
  10. [Route("[controller]/[action]")]
  11. public class TkController : ControllerBase
  12. {
  13. protected IHttpContextAccessor _accessor;
  14. public TkController(IHttpContextAccessor accessor)
  15. {
  16. _accessor = accessor;
  17. }
  18. /// <summary>
  19. /// oppo调用
  20. /// </summary>
  21. /// <param name="s">正文</param>
  22. /// <param name="c">渠道。tb/jd</param>
  23. /// <param name="a">分配的客户端账号</param>
  24. /// <param name="t">11位时间戳</param>
  25. /// <param name="sign">签名</param>
  26. /// <param name="ip">客户的IP</param>
  27. /// <param name="oaid">客户的唯一ID</param>
  28. /// <returns></returns>
  29. [HttpPost]
  30. public async Task<ActionResult> unionParse([FromBody] JsonElement form, [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
  31. {
  32. //正文
  33. var content = form.Read("s", string.Empty);
  34. var channel = form.Read("c", string.Empty);
  35. var ip = form.Read("ip", string.Empty);
  36. var oaid = form.Read("oaid", string.Empty);
  37. var type = form.Read("type", string.Empty);
  38. var clickId = form.Read("clickId", string.Empty);
  39. var commerceType = form.Read<int>("commerceType", 0);
  40. var riskStrategy = form.Read("riskStrategy", string.Empty);
  41. var launchScene = form.Read<int>("launchScene", -1);
  42. var special_text = form.Read<int>("special_text", -1);
  43. var query_text = form.Read("query_text", string.Empty);
  44. var pic = form.Read("pic", string.Empty);
  45. //验证签名
  46. if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
  47. {
  48. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  49. }
  50. DateTime time1 = t.Convert2Datetime();
  51. if (time1 < DateTime.Now.AddMinutes(-10))
  52. {
  53. return new APIResult(new { success = false, message = "验证错误2" }, APIResultCodeEnum.Unauthorized);
  54. }
  55. var account = await ApiAccountCore.GetOneAsync(a);
  56. if (account == null)
  57. {
  58. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  59. }
  60. string app_sign = $"{account.api_secret}@{t}".MD5();
  61. if (sign != app_sign)
  62. {
  63. return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
  64. }
  65. var request = new UnionParseRequest
  66. {
  67. Content = content,
  68. Channel = channel,
  69. CommerceType = commerceType,
  70. Ip = ip,
  71. Oaid = oaid,
  72. RiskStrategy = riskStrategy,
  73. LaunchScene = launchScene,
  74. AccountId = 0,
  75. SpecialText = special_text,
  76. QueryText = query_text,
  77. ClickId = clickId,
  78. Type = type,
  79. Pic = pic,
  80. };
  81. return await UnionParseCore.UnionParseAsync(request);
  82. }
  83. [HttpPost]
  84. public async Task<ActionResult> unsafeParse([FromBody] JsonElement form)
  85. {
  86. var content = form.Read("s", string.Empty);
  87. var channel = form.Read("c", string.Empty);
  88. var ip = form.Read("ip", string.Empty);
  89. var oaid = form.Read("oaid", string.Empty);
  90. var clickId = form.Read("clickId", string.Empty);
  91. var type = form.Read("type", string.Empty);
  92. int accountid = form.Read("aid", 0);
  93. var commerceType = form.Read<int>("commerceType", 0);
  94. var riskStrategy = form.Read("riskStrategy", string.Empty);
  95. var launchScene = form.Read<int>("launchScene", -1);
  96. var special_text = form.Read<int>("special_text", -1);
  97. var query_text = form.Read("query_text", string.Empty);
  98. var pic = form.Read("pic", string.Empty);
  99. #if DEBUG
  100. //ip = "127.0.0.1";
  101. //oaid = "test-oaid";
  102. #endif
  103. var request = new UnionParseRequest
  104. {
  105. Content = content,
  106. Channel = channel,
  107. CommerceType = commerceType,
  108. Ip = ip,
  109. Oaid = oaid,
  110. RiskStrategy = riskStrategy,
  111. LaunchScene = launchScene,
  112. AccountId = accountid,
  113. SpecialText = special_text,
  114. QueryText = query_text,
  115. ClickId = clickId,
  116. Type = type,
  117. Pic = pic,
  118. };
  119. return await UnionParseCore.UnionParseAsync(request);
  120. }
  121. [HttpPost]
  122. public async Task<ActionResult> unsafeBatchParse([FromBody] JsonElement form)
  123. {
  124. var content = form.PathReadArray("s[]", string.Empty);
  125. var channel = form.Read("c", string.Empty);
  126. var ip = form.Read("ip", string.Empty);
  127. var oaid = form.Read("oaid", string.Empty);
  128. var clickId = form.Read("clickId", string.Empty);
  129. var type = form.Read("type", string.Empty);
  130. int accountid = form.Read("aid", 0);
  131. int count = form.Read("count", 0);
  132. var commerceType = form.Read<int>("commerceType", 0);
  133. //入参参数。brw-浏览器,qapp-快应用
  134. var riskStrategy = form.Read("riskStrategy", string.Empty);
  135. var launchScene = form.Read<int>("launchScene", -1);
  136. var special_text = form.Read<int>("special_text", -1);
  137. var query_text = form.Read("query_text", string.Empty);
  138. var pic = form.Read("pic", string.Empty);
  139. #if DEBUG
  140. //ip = "127.0.0.1";
  141. //oaid = "test-oaid";
  142. #endif
  143. for (int i = 0; i < count; i++)
  144. {
  145. var request = new UnionParseRequest
  146. {
  147. Content = content[i],
  148. Channel = channel,
  149. CommerceType = commerceType,
  150. Ip = ip,
  151. Oaid = oaid,
  152. RiskStrategy = riskStrategy,
  153. LaunchScene = launchScene,
  154. AccountId = accountid,
  155. SpecialText = special_text,
  156. QueryText = query_text,
  157. ClickId = clickId,
  158. Type = type,
  159. Pic = pic,
  160. };
  161. _ = await UnionParseCore.UnionParseAsync(request);
  162. }
  163. return new APIResult(new { msg = "ok" });
  164. }
  165. [HttpPost]
  166. public async Task<ActionResult> unionCoupon([FromBody] JsonElement form, [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
  167. {
  168. //正文
  169. var content = form.Read("s", string.Empty);
  170. var dplink = form.Read("dp", string.Empty);
  171. var channel = form.Read("c", string.Empty);
  172. var ip = form.Read("ip", string.Empty);
  173. var oaid = form.Read("oaid", string.Empty);
  174. var clickId = form.Read("clickId", string.Empty);
  175. var style = form.Read("style", string.Empty);
  176. //验证签名
  177. if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
  178. {
  179. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  180. }
  181. DateTime time1 = t.Convert2Datetime();
  182. if (time1 < DateTime.Now.AddMinutes(-10))
  183. {
  184. return new APIResult(new { success = false, message = "验证错误2" }, APIResultCodeEnum.Unauthorized);
  185. }
  186. var account = await ApiAccountCore.GetOneAsync(a);
  187. if (account == null)
  188. {
  189. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  190. }
  191. string app_sign = $"{account.api_secret}@{t}".MD5();
  192. if (sign != app_sign)
  193. {
  194. return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
  195. }
  196. return await UnionCouponCore.UnionCouponAsync(content, dplink, channel, style, ip, oaid, clickId);
  197. }
  198. [HttpPost]
  199. public async Task<ActionResult> unsafeCoupon([FromBody] JsonElement form)
  200. {
  201. var content = form.Read("s", string.Empty);
  202. var dplink = form.Read("dp", string.Empty);
  203. var channel = form.Read("c", string.Empty);
  204. var ip = form.Read("ip", string.Empty);
  205. var oaid = form.Read("oaid", string.Empty);
  206. var style = form.Read("style", string.Empty);
  207. var clickId = form.Read("clickId", string.Empty);
  208. #if DEBUG
  209. ip = "127.0.0.1";
  210. oaid = "test-oaid";
  211. #endif
  212. return await UnionCouponCore.UnionCouponAsync(content, dplink, channel, style, ip, oaid, clickId);
  213. }
  214. [HttpGet]
  215. public async Task<ActionResult> jd_parse(string s, string s2 = "", string ip = "", string oaid = "")
  216. {
  217. UnionParseRequest request = new()
  218. {
  219. Content = s,
  220. Ip = ip,
  221. Oaid = oaid
  222. };
  223. var result = JdUnionPlus.GetFormattedObject(request);
  224. string body = "";
  225. string content = s.UrlDecode();
  226. string content2 = s2.UrlDecode();
  227. try
  228. {
  229. if (AlimamaPlus.ShouldIgnoreRequest(ip, oaid, string.Empty, 0, out string reason))
  230. {
  231. result.success = false;
  232. result.message = "放弃转链";
  233. result.reason = reason;
  234. result.rawContent = content;
  235. result.rawContent2 = content2;
  236. _ = TkLogCore.LogAsync(result);
  237. return new APIResult(result);
  238. }
  239. var api = DataokeCore.GetOne();
  240. if (api == null)
  241. {
  242. result.success = false;
  243. result.message = "放弃转链";
  244. result.reason = "没有匹配账号";
  245. result.rawContent = content;
  246. result.rawContent2 = content2;
  247. _ = TkLogCore.LogAsync(result);
  248. return new APIResult(result);
  249. }
  250. var account = await JdPoolCore.GetOneAsync();
  251. if (account == null)
  252. {
  253. result.success = false;
  254. result.message = "放弃转链";
  255. result.reason = "没有匹配账号";
  256. result.rawContent = content;
  257. result.rawContent2 = content2;
  258. _ = TkLogCore.LogAsync(result);
  259. return new APIResult(result);
  260. }
  261. result = DataokeCore.JdParse(result, api, account, content);
  262. }
  263. catch (Exception ex)
  264. {
  265. _ = new LoggerLibrary("api_error")
  266. .Info(s, s2)
  267. .Info("【jd】", body)
  268. .Info(ex.Message, ex.StackTrace)
  269. .SaveAsync();
  270. NotifyCore.Notify(new NifyMessage
  271. {
  272. message = $"【转链接口异常】\n{content}\n{content2}\n{body}\n\n{ex.Message}\n{ex.StackTrace}",
  273. priority = NifyMessagePriority.high,
  274. tags = ["red_circle"]
  275. });
  276. result.success = false;
  277. result.message = "放弃转链";
  278. result.reason = "转链接口异常";
  279. }
  280. result.rawContent = content;
  281. result.rawContent2 = content2;
  282. _ = TkLogCore.LogAsync(result);
  283. return new APIResult(new
  284. {
  285. result.success,
  286. result.message,
  287. result.shortLinkurl,
  288. result.itemId,
  289. result.itemName,
  290. result.deeplink_url,
  291. });
  292. }
  293. [HttpGet]
  294. public async Task<ActionResult> Reload()
  295. {
  296. await EndPointCore.NotifyReload();
  297. return new APIResult(new
  298. {
  299. success = true,
  300. message = "ok",
  301. });
  302. }
  303. [HttpGet]
  304. public async Task<ActionResult> dplist([FromQuery] string query = "", [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
  305. {
  306. var clientIp = _accessor.HttpContext.GetUserIp();
  307. //验证签名
  308. if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
  309. {
  310. _ = new LoggerLibrary("api", "dplist_error")
  311. .Info($"{clientIp}\t{query}")
  312. .Info($"{a}\t{sign}\t{t}")
  313. .Info("验证错误")
  314. .SaveAsync();
  315. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  316. }
  317. DateTime time1 = t.Convert2Datetime();
  318. if (time1 < DateTime.Now.AddMinutes(-10))
  319. {
  320. _ = new LoggerLibrary("api", "dplist_error")
  321. .Info($"{clientIp}\t{query}")
  322. .Info($"{a}\t{sign}\t{t}")
  323. .Info("验证错误2")
  324. .SaveAsync();
  325. return new APIResult(new { success = false, message = "验证错误2" }, APIResultCodeEnum.Unauthorized);
  326. }
  327. var account = await ApiAccountCore.GetOneAsync(a);
  328. if (account == null)
  329. {
  330. _ = new LoggerLibrary("api", "dplist_error")
  331. .Info($"{clientIp}\t{query}")
  332. .Info($"{a}\t{sign}\t{t}")
  333. .Info("验证错误3")
  334. .SaveAsync();
  335. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  336. }
  337. string app_sign = $"{account.api_secret}@{t}".MD5();
  338. if (sign != app_sign)
  339. {
  340. _ = new LoggerLibrary("api", "dplist_error")
  341. .Info($"{clientIp}\t{query}")
  342. .Info($"{a}\t{sign}\t{t}")
  343. .Info("验证错误4")
  344. .SaveAsync();
  345. return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
  346. }
  347. if (string.IsNullOrEmpty(query))
  348. {
  349. _ = new LoggerLibrary("api", "dplist_error")
  350. .Info($"{clientIp}\t{query}")
  351. .Info($"{a}\t{sign}\t{t}")
  352. .Info("查询条件不能为空")
  353. .SaveAsync();
  354. return new APIResult(new { success = false, message = "查询条件不能为空" });
  355. }
  356. int[] report_account_ids = account.report_account_ids.TryToArray<int>(',');
  357. int[] report_exclude_account_ids = account.report_exclude_account_ids.TryToArray<int>(',');
  358. string filter = $"batchId=@query";
  359. var account_list = await TkPoolCore.ListAsync();
  360. List<int> account_ids = [];
  361. if (account_list.Any())
  362. {
  363. account_ids = account_list.Where(e => e.enable_fake_click).Select(e => e.id).ToList();
  364. if (report_account_ids.Length > 0)
  365. {
  366. account_ids = account_ids.Intersect(report_account_ids).ToList();
  367. }
  368. if (report_exclude_account_ids.Length > 0)
  369. {
  370. account_ids = account_ids.Except(report_exclude_account_ids).ToList();
  371. }
  372. filter += $" AND accountId IN @account_ids";
  373. }
  374. string orderBy = "paid_time ASC";
  375. var data = new DBContext.Table("tk_order_tracking")
  376. .Where(filter, new { query, account_ids })
  377. .Order(orderBy)
  378. .Select<TkOrderTrackingDTO>();
  379. //fake_click_link_type
  380. List<object> list = [];
  381. foreach (var item in data)
  382. {
  383. list.Add(new { pid = item.accountId, url = item.deeplinkUrl, item.shortLinkUrl, count = item.click_num, time = item.exp_time });
  384. }
  385. var ids = data.Select(e => e.Id).ToArray();
  386. _ = new LoggerLibrary("api", "dplist")
  387. .Info($"{clientIp}\t{query}\tcount:{list.Count}")
  388. .Info(string.Join(',', ids))
  389. .SaveAsync();
  390. var update = new DBContext.Table("tk_order_tracking")
  391. .Add("last_pull_time", DateTime.Now)
  392. .Add("last_pull_account", account.name)
  393. .Add("clicked_num:", "clicked_num+1")
  394. .Where("id IN @ids", new { ids })
  395. .Update();
  396. return new APIResult(new
  397. {
  398. success = true,
  399. message = list.Count == 0 ? "none" : "ok",
  400. count = list.Count,
  401. data = list,
  402. });
  403. }
  404. [HttpGet]
  405. public async Task<ActionResult> unsafeParseDpList([FromQuery] string a = "", [FromQuery] string query = "")
  406. {
  407. if (string.IsNullOrEmpty(a))
  408. {
  409. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  410. }
  411. var account = await ApiAccountCore.GetOneAsync(a);
  412. if (account == null || !account.enable_report)
  413. {
  414. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  415. }
  416. if (string.IsNullOrEmpty(query))
  417. {
  418. return new APIResult(new { success = false, message = "查询条件不能为空" });
  419. }
  420. int[] report_account_ids = account.report_account_ids.TryToArray<int>(',');
  421. int[] report_exclude_account_ids = account.report_exclude_account_ids.TryToArray<int>(',');
  422. string filter = $"batchId=@query";
  423. var account_list = await TkPoolCore.ListAsync();
  424. List<int> account_ids = [];
  425. if (account_list.Any())
  426. {
  427. account_ids = account_list.Where(e => e.enable_fake_click).Select(e => e.id).ToList();
  428. if (report_account_ids.Length > 0)
  429. {
  430. account_ids = account_ids.Intersect(report_account_ids).ToList();
  431. }
  432. if (report_exclude_account_ids.Length > 0)
  433. {
  434. account_ids = account_ids.Except(report_exclude_account_ids).ToList();
  435. }
  436. filter += $" AND accountId IN @account_ids";
  437. }
  438. string orderBy = "paid_time ASC";
  439. var data = new DBContext.Table("tk_order_tracking")
  440. .Where(filter, new { query, account_ids })
  441. .Order(orderBy)
  442. .Select<TkOrderTrackingDTO>();
  443. List<object> list = [];
  444. foreach (var item in data)
  445. {
  446. list.Add(new { pid = item.accountId, url = item.deeplinkUrl, item.shortLinkUrl, count = item.click_num, time = item.exp_time });
  447. }
  448. var clientIp = _accessor.HttpContext.GetUserIp();
  449. LoggerLibrary log = new LoggerLibrary("api", "unsafeParseDpList");
  450. log.Info($"{clientIp}\t{query}\tcount:{list.Count}");
  451. var ids = data.Select(e => e.Id).ToArray();
  452. log.Info(string.Join(',', ids));
  453. _ = log.SaveAsync();
  454. return new APIResult(new
  455. {
  456. success = true,
  457. message = list.Count == 0 ? "none" : "ok",
  458. count = list.Count,
  459. data = list,
  460. });
  461. }
  462. [HttpPost]
  463. public async Task<ActionResult> dataReport([FromBody] JsonElement form, [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
  464. {
  465. bool debug = form.Read("debug", false);
  466. var clientIp = _accessor.HttpContext.GetUserIp();
  467. var log = new LoggerLibrary("ApiReportCore", "dataReport");
  468. log.Info(clientIp);
  469. //验证签名
  470. if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
  471. {
  472. _ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\t", $"message:验证错误")
  473. .Info(form.GetRawText())
  474. .SaveAsync();
  475. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  476. }
  477. DateTime time1 = t.Convert2Datetime();
  478. if (time1 < DateTime.Now.AddMinutes(-10))
  479. {
  480. _ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\t", $"message:验证错误2")
  481. .Info(form.GetRawText())
  482. .SaveAsync();
  483. return new APIResult(new { success = false, message = "验证错误2" }, APIResultCodeEnum.Unauthorized);
  484. }
  485. var account = await ApiAccountCore.GetOneAsync(a);
  486. if (account == null)
  487. {
  488. _ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\t", $"message:验证错误3")
  489. .Info(form.GetRawText())
  490. .SaveAsync();
  491. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  492. }
  493. string app_sign = $"{account.api_secret}@{t}".MD5();
  494. if (sign != app_sign)
  495. {
  496. _ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\tapp_sign:{app_sign}", $"message:验证错误4")
  497. .Info(form.GetRawText())
  498. .SaveAsync();
  499. return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
  500. }
  501. try
  502. {
  503. //0:全分销类型;-1:各分销类型,1:goods 2: live 3:video 4: profile 5: unknown
  504. int distributiontype = form.Read("distributiontype", 0);
  505. //0:全平台;-1:各平台;1:淘宝 2:京东 2:多多
  506. int platform = form.Read("platform", 0);
  507. var data = await ApiReportCore.ReportDailysAsync(form, clientIp, debug);
  508. _ = log.Info(form.GetRawText(), data.Convert2Json()).SaveAsync();
  509. return new APIResult(new { success = true, platform, distributiontype, data });
  510. }
  511. catch (Exception ex)
  512. {
  513. _ = log.Info(form.GetRawText()).Info(ex.Message, ex.StackTrace).SaveAsync();
  514. return new APIResult(new { success = false, message = "内部错误" });
  515. }
  516. }
  517. [HttpPost]
  518. public async Task<ActionResult> unsafeDataReport([FromBody] JsonElement form)
  519. {
  520. bool debug = form.Read("debug", false);
  521. var clientIp = _accessor.HttpContext.GetUserIp();
  522. var log = new LoggerLibrary("ApiReportCore", "unsafeDataReport");
  523. log.Info(clientIp);
  524. try
  525. {
  526. //0:全分销类型;-1:各分销类型,1:goods 2: live 3:video 4: profile 5: unknown
  527. int distributiontype = form.Read("distributiontype", 0);
  528. //0:全平台;-1:各平台;1:淘宝 2:京东
  529. int platform = form.Read("platform", 0);
  530. var data = await ApiReportCore.ReportDailysAsync(form, clientIp, debug);
  531. _ = log.Info(form.GetRawText(), data.Convert2Json()).SaveAsync();
  532. return new APIResult(new { success = true, platform, distributiontype, data });
  533. }
  534. catch (Exception ex)
  535. {
  536. _ = log.Info(form.GetRawText()).Info(ex.Message, ex.StackTrace).SaveAsync();
  537. return new APIResult(new { success = false, message = "内部错误" });
  538. }
  539. }
  540. }
  541. }