TkController.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  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. RiskStrategy = string.Empty,
  223. LaunchScene = 0,
  224. };
  225. var result = JdUnionPlus.GetFormattedObject(request);
  226. string body = "";
  227. string content = s.UrlDecode();
  228. string content2 = s2.UrlDecode();
  229. try
  230. {
  231. if (AlimamaPlus.ShouldIgnoreRequest(request, out string reason))
  232. {
  233. result.success = false;
  234. result.message = "放弃转链";
  235. result.reason = reason;
  236. result.rawContent = content;
  237. result.rawContent2 = content2;
  238. _ = TkLogCore.LogAsync(result);
  239. return new APIResult(result);
  240. }
  241. var api = DataokeCore.GetOne();
  242. if (api == null)
  243. {
  244. result.success = false;
  245. result.message = "放弃转链";
  246. result.reason = "没有匹配账号";
  247. result.rawContent = content;
  248. result.rawContent2 = content2;
  249. _ = TkLogCore.LogAsync(result);
  250. return new APIResult(result);
  251. }
  252. var account = await JdPoolCore.GetOneAsync();
  253. if (account == null)
  254. {
  255. result.success = false;
  256. result.message = "放弃转链";
  257. result.reason = "没有匹配账号";
  258. result.rawContent = content;
  259. result.rawContent2 = content2;
  260. _ = TkLogCore.LogAsync(result);
  261. return new APIResult(result);
  262. }
  263. result = DataokeCore.JdParse(result, api, account, content);
  264. }
  265. catch (Exception ex)
  266. {
  267. _ = new LoggerLibrary("api_error")
  268. .Info(s, s2)
  269. .Info("【jd】", body)
  270. .Info(ex.Message, ex.StackTrace)
  271. .SaveAsync();
  272. NotifyCore.Notify(new NifyMessage
  273. {
  274. message = $"【转链接口异常】\n{content}\n{content2}\n{body}\n\n{ex.Message}\n{ex.StackTrace}",
  275. priority = NifyMessagePriority.high,
  276. tags = ["red_circle"]
  277. });
  278. result.success = false;
  279. result.message = "放弃转链";
  280. result.reason = "转链接口异常";
  281. }
  282. result.rawContent = content;
  283. result.rawContent2 = content2;
  284. _ = TkLogCore.LogAsync(result);
  285. return new APIResult(new
  286. {
  287. result.success,
  288. result.message,
  289. result.shortLinkurl,
  290. result.itemId,
  291. result.itemName,
  292. result.deeplink_url,
  293. });
  294. }
  295. [HttpGet]
  296. public async Task<ActionResult> Reload()
  297. {
  298. await EndPointCore.NotifyReload();
  299. return new APIResult(new
  300. {
  301. success = true,
  302. message = "ok",
  303. });
  304. }
  305. [HttpGet]
  306. public async Task<ActionResult> dplist([FromQuery] string query = "", [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
  307. {
  308. var clientIp = _accessor.HttpContext.GetUserIp();
  309. //验证签名
  310. if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
  311. {
  312. _ = new LoggerLibrary("api", "dplist_error")
  313. .Info($"{clientIp}\t{query}")
  314. .Info($"{a}\t{sign}\t{t}")
  315. .Info("验证错误")
  316. .SaveAsync();
  317. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  318. }
  319. DateTime time1 = t.Convert2Datetime();
  320. if (time1 < DateTime.Now.AddMinutes(-10))
  321. {
  322. _ = new LoggerLibrary("api", "dplist_error")
  323. .Info($"{clientIp}\t{query}")
  324. .Info($"{a}\t{sign}\t{t}")
  325. .Info("验证错误2")
  326. .SaveAsync();
  327. return new APIResult(new { success = false, message = "验证错误2" }, APIResultCodeEnum.Unauthorized);
  328. }
  329. var account = await ApiAccountCore.GetOneAsync(a);
  330. if (account == null)
  331. {
  332. _ = new LoggerLibrary("api", "dplist_error")
  333. .Info($"{clientIp}\t{query}")
  334. .Info($"{a}\t{sign}\t{t}")
  335. .Info("验证错误3")
  336. .SaveAsync();
  337. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  338. }
  339. string app_sign = $"{account.api_secret}@{t}".MD5();
  340. if (sign != app_sign)
  341. {
  342. _ = new LoggerLibrary("api", "dplist_error")
  343. .Info($"{clientIp}\t{query}")
  344. .Info($"{a}\t{sign}\t{t}")
  345. .Info("验证错误4")
  346. .SaveAsync();
  347. return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
  348. }
  349. if (string.IsNullOrEmpty(query))
  350. {
  351. _ = new LoggerLibrary("api", "dplist_error")
  352. .Info($"{clientIp}\t{query}")
  353. .Info($"{a}\t{sign}\t{t}")
  354. .Info("查询条件不能为空")
  355. .SaveAsync();
  356. return new APIResult(new { success = false, message = "查询条件不能为空" });
  357. }
  358. int[] report_account_ids = account.report_account_ids.TryToArray<int>(',');
  359. int[] report_exclude_account_ids = account.report_exclude_account_ids.TryToArray<int>(',');
  360. string filter = $"batchId=@query";
  361. var account_list = await TkPoolCore.ListAsync();
  362. List<int> account_ids = [];
  363. if (account_list.Any())
  364. {
  365. account_ids = account_list.Where(e => e.enable_fake_click).Select(e => e.id).ToList();
  366. if (report_account_ids.Length > 0)
  367. {
  368. account_ids = account_ids.Intersect(report_account_ids).ToList();
  369. }
  370. if (report_exclude_account_ids.Length > 0)
  371. {
  372. account_ids = account_ids.Except(report_exclude_account_ids).ToList();
  373. }
  374. filter += $" AND accountId IN @account_ids";
  375. }
  376. string orderBy = "paid_time ASC";
  377. var data = new DBContext.Table("tk_order_tracking")
  378. .Where(filter, new { query, account_ids })
  379. .Order(orderBy)
  380. .Select<TkOrderTrackingDTO>();
  381. //fake_click_link_type
  382. List<object> list = [];
  383. foreach (var item in data)
  384. {
  385. list.Add(new { pid = item.accountId, url = item.deeplinkUrl, item.shortLinkUrl, count = item.click_num, time = item.exp_time });
  386. }
  387. var ids = data.Select(e => e.Id).ToArray();
  388. _ = new LoggerLibrary("api", "dplist")
  389. .Info($"{clientIp}\t{query}\tcount:{list.Count}")
  390. .Info(string.Join(',', ids))
  391. .SaveAsync();
  392. var update = new DBContext.Table("tk_order_tracking")
  393. .Add("last_pull_time", DateTime.Now)
  394. .Add("last_pull_account", account.name)
  395. .Add("clicked_num:", "clicked_num+1")
  396. .Where("id IN @ids", new { ids })
  397. .Update();
  398. return new APIResult(new
  399. {
  400. success = true,
  401. message = list.Count == 0 ? "none" : "ok",
  402. count = list.Count,
  403. data = list,
  404. });
  405. }
  406. [HttpGet]
  407. public async Task<ActionResult> unsafeParseDpList([FromQuery] string a = "", [FromQuery] string query = "")
  408. {
  409. if (string.IsNullOrEmpty(a))
  410. {
  411. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  412. }
  413. var account = await ApiAccountCore.GetOneAsync(a);
  414. if (account == null || !account.enable_report)
  415. {
  416. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  417. }
  418. if (string.IsNullOrEmpty(query))
  419. {
  420. return new APIResult(new { success = false, message = "查询条件不能为空" });
  421. }
  422. int[] report_account_ids = account.report_account_ids.TryToArray<int>(',');
  423. int[] report_exclude_account_ids = account.report_exclude_account_ids.TryToArray<int>(',');
  424. string filter = $"batchId=@query";
  425. var account_list = await TkPoolCore.ListAsync();
  426. List<int> account_ids = [];
  427. if (account_list.Any())
  428. {
  429. account_ids = account_list.Where(e => e.enable_fake_click).Select(e => e.id).ToList();
  430. if (report_account_ids.Length > 0)
  431. {
  432. account_ids = account_ids.Intersect(report_account_ids).ToList();
  433. }
  434. if (report_exclude_account_ids.Length > 0)
  435. {
  436. account_ids = account_ids.Except(report_exclude_account_ids).ToList();
  437. }
  438. filter += $" AND accountId IN @account_ids";
  439. }
  440. string orderBy = "paid_time ASC";
  441. var data = new DBContext.Table("tk_order_tracking")
  442. .Where(filter, new { query, account_ids })
  443. .Order(orderBy)
  444. .Select<TkOrderTrackingDTO>();
  445. List<object> list = [];
  446. foreach (var item in data)
  447. {
  448. list.Add(new { pid = item.accountId, url = item.deeplinkUrl, item.shortLinkUrl, count = item.click_num, time = item.exp_time });
  449. }
  450. var clientIp = _accessor.HttpContext.GetUserIp();
  451. LoggerLibrary log = new LoggerLibrary("api", "unsafeParseDpList");
  452. log.Info($"{clientIp}\t{query}\tcount:{list.Count}");
  453. var ids = data.Select(e => e.Id).ToArray();
  454. log.Info(string.Join(',', ids));
  455. _ = log.SaveAsync();
  456. return new APIResult(new
  457. {
  458. success = true,
  459. message = list.Count == 0 ? "none" : "ok",
  460. count = list.Count,
  461. data = list,
  462. });
  463. }
  464. [HttpPost]
  465. public async Task<ActionResult> dataReport([FromBody] JsonElement form, [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
  466. {
  467. bool debug = form.Read("debug", false);
  468. var clientIp = _accessor.HttpContext.GetUserIp();
  469. var log = new LoggerLibrary("ApiReportCore", "dataReport");
  470. log.Info(clientIp);
  471. //验证签名
  472. if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
  473. {
  474. _ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\t", $"message:验证错误")
  475. .Info(form.GetRawText())
  476. .SaveAsync();
  477. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  478. }
  479. DateTime time1 = t.Convert2Datetime();
  480. if (time1 < DateTime.Now.AddMinutes(-10))
  481. {
  482. _ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\t", $"message:验证错误2")
  483. .Info(form.GetRawText())
  484. .SaveAsync();
  485. return new APIResult(new { success = false, message = "验证错误2" }, APIResultCodeEnum.Unauthorized);
  486. }
  487. var account = await ApiAccountCore.GetOneAsync(a);
  488. if (account == null)
  489. {
  490. _ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\t", $"message:验证错误3")
  491. .Info(form.GetRawText())
  492. .SaveAsync();
  493. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  494. }
  495. string app_sign = $"{account.api_secret}@{t}".MD5();
  496. if (sign != app_sign)
  497. {
  498. _ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\tapp_sign:{app_sign}", $"message:验证错误4")
  499. .Info(form.GetRawText())
  500. .SaveAsync();
  501. return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
  502. }
  503. try
  504. {
  505. //0:全分销类型;-1:各分销类型,1:goods 2: live 3:video 4: profile 5: unknown
  506. int distributiontype = form.Read("distributiontype", 0);
  507. //0:全平台;-1:各平台;1:淘宝 2:京东 2:多多
  508. int platform = form.Read("platform", 0);
  509. var data = await ApiReportCore.ReportDailysAsync(form, clientIp, debug);
  510. _ = log.Info(form.GetRawText(), data.Convert2Json()).SaveAsync();
  511. return new APIResult(new { success = true, platform, distributiontype, data });
  512. }
  513. catch (Exception ex)
  514. {
  515. _ = log.Info(form.GetRawText()).Info(ex.Message, ex.StackTrace).SaveAsync();
  516. return new APIResult(new { success = false, message = "内部错误" });
  517. }
  518. }
  519. [HttpPost]
  520. public async Task<ActionResult> unsafeDataReport([FromBody] JsonElement form)
  521. {
  522. bool debug = form.Read("debug", false);
  523. var clientIp = _accessor.HttpContext.GetUserIp();
  524. var log = new LoggerLibrary("ApiReportCore", "unsafeDataReport");
  525. log.Info(clientIp);
  526. try
  527. {
  528. //0:全分销类型;-1:各分销类型,1:goods 2: live 3:video 4: profile 5: unknown
  529. int distributiontype = form.Read("distributiontype", 0);
  530. //0:全平台;-1:各平台;1:淘宝 2:京东
  531. int platform = form.Read("platform", 0);
  532. var data = await ApiReportCore.ReportDailysAsync(form, clientIp, debug);
  533. _ = log.Info(form.GetRawText(), data.Convert2Json()).SaveAsync();
  534. return new APIResult(new { success = true, platform, distributiontype, data });
  535. }
  536. catch (Exception ex)
  537. {
  538. _ = log.Info(form.GetRawText()).Info(ex.Message, ex.StackTrace).SaveAsync();
  539. return new APIResult(new { success = false, message = "内部错误" });
  540. }
  541. }
  542. }
  543. }