HomeController.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. using LitJson;
  8. using System;
  9. namespace MySystem.Controllers
  10. {
  11. public class HomeController : Controller
  12. {
  13. private readonly ILogger<HomeController> _logger;
  14. public HomeController(ILogger<HomeController> logger)
  15. {
  16. _logger = logger;
  17. }
  18. public IActionResult Index()
  19. {
  20. return View();
  21. }
  22. public IActionResult Error()
  23. {
  24. string isapi = Request.Headers["Api"].ToString();
  25. if (isapi != "1")
  26. {
  27. if (Response.StatusCode == 500)
  28. {
  29. return Redirect("/public/errpage/pc/500.html");
  30. }
  31. else if (Response.StatusCode == 502)
  32. {
  33. return Redirect("/public/errpage/pc/502.html");
  34. }
  35. else if (Response.StatusCode == 404)
  36. {
  37. return Redirect("/public/errpage/pc/404.html");
  38. }
  39. else if (Response.StatusCode == 401)
  40. {
  41. return Content("401");
  42. }
  43. }
  44. return View();
  45. }
  46. public string test()
  47. {
  48. string result = "";
  49. // List<ReceiverList> Receivers = new List<ReceiverList>();
  50. // Receivers.Add(new ReceiverList()
  51. // {
  52. // type = "MERCHANT_ID", //分账接收方类型
  53. // account = "1611167423", //分账接收方账号
  54. // amount = 1, //分账金额
  55. // description = "服务费", //分账描述
  56. // });
  57. // Receivers.Add(new ReceiverList()
  58. // {
  59. // type = "PERSONAL_OPENID", //分账接收方类型
  60. // account = "ooDpv5LkCKEguE-LMZO-rSV4TDpk", //分账接收方账号
  61. // amount = 1, //分账金额
  62. // description = "优惠", //分账描述
  63. // });
  64. // result = new WeChatFunction().ProfitShare("1645266943", "4200001846202306021274142861", "2023060214014405449699901", Receivers);
  65. // result = new WeChatFunction().AddReceive("1645266943", "PERSONAL_OPENID", "ooDpv5LkCKEguE-LMZO-rSV4TDpk", "", "USER");
  66. // result = new WeChatFunction().QueryProfitShare("1645266943", "4200001815202306025662773463", "2023060213335030713572885");
  67. result = new WeChatFunction().Unfreeze("1646405429","4200001838202306096719040741","2023060911284179905894403", "结算");
  68. // result = new WeChatFunction().ProfitShareReturn("1646405429", "1611167423", "2023060810550382756164803", DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8), 0.02M);
  69. return result;
  70. }
  71. }
  72. }