HomeController.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Data;
  6. using System.Threading.Tasks;
  7. using Microsoft.AspNetCore.Mvc;
  8. using Microsoft.Extensions.Logging;
  9. using System.Threading;
  10. using Library;
  11. using LitJson;
  12. namespace MySystem.Controllers
  13. {
  14. public class HomeController : Controller
  15. {
  16. private readonly ILogger<HomeController> _logger;
  17. public HomeController(ILogger<HomeController> logger)
  18. {
  19. _logger = logger;
  20. }
  21. public IActionResult Index()
  22. {
  23. return View();
  24. }
  25. public IActionResult Error()
  26. {
  27. string isapi = Request.Headers["Api"].ToString();
  28. if (isapi != "1")
  29. {
  30. if (Response.StatusCode == 500)
  31. {
  32. return Redirect("/public/errpage/pc/500.html");
  33. }
  34. else if (Response.StatusCode == 502)
  35. {
  36. return Redirect("/public/errpage/pc/502.html");
  37. }
  38. else if (Response.StatusCode == 404)
  39. {
  40. return Redirect("/public/errpage/pc/404.html");
  41. }
  42. }
  43. return View();
  44. }
  45. public string test()
  46. {
  47. TableSplitService.Instance.AddRecordTable("202306", "TradeRecord");
  48. return "ok";
  49. }
  50. }
  51. }