TkController.cs 24 KB

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