|
|
@@ -112,31 +112,31 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
- [Route("/api/v1/{c1}/{c2}")]
|
|
|
- public JsonResult ToApServer(string c1, string c2, string value)
|
|
|
- {
|
|
|
- string apis = function.CheckNull(RedisDbconn.Instance.Get<string>("ToApServer"));
|
|
|
- function.WriteLog(DateTime.Now.ToString() + "\n" + value, "接口转发日志");
|
|
|
- string hasDo = "";
|
|
|
- if (apis.Contains(c1 + "/" + c2))
|
|
|
- {
|
|
|
- value = dbconn.DesEncrypt(value, "*ga34|^7");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- hasDo = "do";
|
|
|
- }
|
|
|
- function.WriteLog(value, "接口转发日志");
|
|
|
- string url = AppConfig.Base.ApHost + "api/v1/" + c1 + "/" + c2 + hasDo;
|
|
|
- function.WriteLog(url, "接口转发日志");
|
|
|
- string result = function.PostWebRequest(url, "value=" + value);
|
|
|
- function.WriteLog(str: result, "接口转发日志");
|
|
|
- JsonData data = JsonMapper.ToObject(result);
|
|
|
- if(result.Contains("\"status\""))
|
|
|
- {
|
|
|
- return Json(new AppResultJson() { Status = data["status"].ToString(), Data = data["data"].ToJson(), Info = data["info"].ToString(), Other = data["other"] == null ? "" : data["other"].ToJson(), Timestamp = int.Parse(function.CheckInt(data["timestamp"].ToString())) });
|
|
|
- }
|
|
|
- return Json(new AppResultJson() { Status = "1", Data = result, Info = "" });
|
|
|
- }
|
|
|
+ // [Route("/api/v1/{c1}/{c2}")]
|
|
|
+ // public JsonResult ToApServer(string c1, string c2, string value)
|
|
|
+ // {
|
|
|
+ // string apis = function.CheckNull(RedisDbconn.Instance.Get<string>("ToApServer"));
|
|
|
+ // function.WriteLog(DateTime.Now.ToString() + "\n" + value, "接口转发日志");
|
|
|
+ // string hasDo = "";
|
|
|
+ // if (apis.Contains(c1 + "/" + c2))
|
|
|
+ // {
|
|
|
+ // value = dbconn.DesEncrypt(value, "*ga34|^7");
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // hasDo = "do";
|
|
|
+ // }
|
|
|
+ // function.WriteLog(value, "接口转发日志");
|
|
|
+ // string url = AppConfig.Base.ApHost + "api/v1/" + c1 + "/" + c2 + hasDo;
|
|
|
+ // function.WriteLog(url, "接口转发日志");
|
|
|
+ // string result = function.PostWebRequest(url, "value=" + value);
|
|
|
+ // function.WriteLog(str: result, "接口转发日志");
|
|
|
+ // JsonData data = JsonMapper.ToObject(result);
|
|
|
+ // if(result.Contains("\"status\""))
|
|
|
+ // {
|
|
|
+ // return Json(new AppResultJson() { Status = data["status"].ToString(), Data = data["data"].ToJson(), Info = data["info"].ToString(), Other = data["other"] == null ? "" : data["other"].ToJson(), Timestamp = int.Parse(function.CheckInt(data["timestamp"].ToString())) });
|
|
|
+ // }
|
|
|
+ // return Json(new AppResultJson() { Status = "1", Data = result, Info = "" });
|
|
|
+ // }
|
|
|
}
|
|
|
}
|