HomeController.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using System.Collections.Generic;
  2. using Microsoft.AspNetCore.Mvc;
  3. using Microsoft.Extensions.Logging;
  4. using MySystem.MainModels;
  5. using System.Linq;
  6. using Library;
  7. namespace MySystem.Controllers
  8. {
  9. public class HomeController : Controller
  10. {
  11. private readonly ILogger<HomeController> _logger;
  12. public HomeController(ILogger<HomeController> logger)
  13. {
  14. _logger = logger;
  15. }
  16. public IActionResult Index()
  17. {
  18. return View();
  19. }
  20. public IActionResult Error()
  21. {
  22. string isapi = Request.Headers["Api"].ToString();
  23. if (isapi != "1")
  24. {
  25. if (Response.StatusCode == 500)
  26. {
  27. return Redirect("/public/errpage/pc/500.html");
  28. }
  29. else if (Response.StatusCode == 502)
  30. {
  31. return Redirect("/public/errpage/pc/502.html");
  32. }
  33. else if (Response.StatusCode == 404)
  34. {
  35. return Redirect("/public/errpage/pc/404.html");
  36. }
  37. }
  38. return View();
  39. }
  40. #region ios配置文件
  41. [Route("/apple-app-site-association")]
  42. public Dictionary<string, object> iosSetting()
  43. {
  44. Dictionary<string, object> result = new Dictionary<string, object>();
  45. Dictionary<string, object> webcredentials = new Dictionary<string, object>();
  46. List<string> apps = new List<string>();
  47. apps.Add("7HQBL6X2N5.com.kexiaoshuang.creator");
  48. webcredentials.Add("apps", apps);
  49. result.Add("webcredentials", webcredentials);
  50. Dictionary<string, object> applinks = new Dictionary<string, object>();
  51. apps = new List<string>();
  52. applinks.Add("apps", apps);
  53. List<Dictionary<string, object>> details = new List<Dictionary<string, object>>();
  54. Dictionary<string, object> detailsItem = new Dictionary<string, object>();
  55. detailsItem.Add("appID", "7HQBL6X2N5.com.kexiaoshuang.creator");
  56. detailsItem.Add("paths", "/creator/ios/*");
  57. details.Add(detailsItem);
  58. applinks.Add("details", details);
  59. result.Add("applinks", applinks);
  60. return result;
  61. }
  62. #endregion
  63. }
  64. }