HomeController.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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.ios");
  48. webcredentials.Add("apps", apps);
  49. result.Add("webcredentials", webcredentials);
  50. return result;
  51. }
  52. #endregion
  53. }
  54. }