12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using System.Collections.Generic;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.Extensions.Logging;
- using MySystem.MainModels;
- using System.Linq;
- using Library;
- using LitJson;
- namespace MySystem.Controllers
- {
- public class HomeController : Controller
- {
- private readonly ILogger<HomeController> _logger;
- public HomeController(ILogger<HomeController> logger)
- {
- _logger = logger;
- }
- public IActionResult Index()
- {
- return View();
- }
- public IActionResult Error()
- {
- string isapi = Request.Headers["Api"].ToString();
- if (isapi != "1")
- {
- if (Response.StatusCode == 500)
- {
- return Redirect("/public/errpage/pc/500.html");
- }
- else if (Response.StatusCode == 502)
- {
- return Redirect("/public/errpage/pc/502.html");
- }
- else if (Response.StatusCode == 404)
- {
- return Redirect("/public/errpage/pc/404.html");
- }
- else if (Response.StatusCode == 401)
- {
- return Content("401");
- }
- }
- return View();
- }
- public string test()
- {
- List<ReceiverList> Receivers = new List<ReceiverList>();
- Receivers.Add(new ReceiverList()
- {
- type = "MERCHANT_ID", //分账接收方类型
- account = "1611167423", //分账接收方账号
- amount = 1, //分账金额
- description = "服务费", //分账描述
- });
- string result = new WeChatFunction().ProfitShare("1645266943", "4200001833202306012813500432", "2023060113423544310448679", Receivers);
- return result;
- }
- }
- }
|