123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- using System.Linq;
- using Library;
- using LitJson;
- using System;
- using System.IO;
- using System.Text.RegularExpressions;
- 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 auth(string app_id, string source, string application_type, string app_auth_code, string state)
- {
- return app_id + "\n" + source + "\n" + application_type + "\n" + app_auth_code + "\n" + state + "\n" + Request.QueryString.ToString();
- }
- public string test()
- {
- string result = "ok";
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- string logcontent = function.ReadInstance("直联微信.log");
- string[] contents = logcontent.Split('\n');
- foreach(string content in contents)
- {
- RedisDbconn.Instance.AddList("WeChatPayBack", content);
- }
- logcontent = function.ReadInstance("银联微信.log");
- contents = logcontent.Split('\n');
- foreach(string content in contents)
- {
- RedisDbconn.Instance.AddList("WeChatPayBackHd", content);
- }
- logcontent = function.ReadInstance("银联支付宝.log");
- contents = logcontent.Split('\n');
- foreach(string content in contents)
- {
- RedisDbconn.Instance.AddList("WeChatPayBackHd", content);
- }
- return result;
- }
- public string OrderCheck(string d, int m)
- {
- string[] datelist = d.Split('-');
- string path = "";
- if(m == 1) path = "支付宝服务平台支付回调(好哒)";
- if(m == 2) path = "微信服务平台支付回调(好哒)";
- string logcontent = function.ReadInstance("/log/" + path + "/" + datelist[0] + "/" + datelist[1] + "/" + datelist[2] + "/content.log");
- MatchCollection mc = Regex.Matches(logcontent, "{.*?}");
- foreach(Match match in mc)
- {
- string content = match.Value;
- RedisDbconn.Instance.AddList("WeChatPayBackHd", content);
- }
- return "ok";
- }
- }
- }
|