Browse Source

修复接口

lcl 1 năm trước cách đây
mục cha
commit
e84e9ddb43
2 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. BIN
      .DS_Store
  2. 4 2
      Areas/Api/Controllers/OutApiController.cs

BIN
.DS_Store


+ 4 - 2
Areas/Api/Controllers/OutApiController.cs

@@ -113,7 +113,7 @@ namespace MySystem.Areas.Api.Controllers.v1
 
 
         [Route("/api/v1/{c1}/{c2}")]
-        public string ToApServer(string c1, string c2, string value)
+        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, "接口转发日志");
@@ -131,7 +131,9 @@ namespace MySystem.Areas.Api.Controllers.v1
             function.WriteLog(url, "接口转发日志");
             string result = function.PostWebRequest(url, "value=" + value);
             function.WriteLog(result, "接口转发日志");
-            return result;
+            JsonData data = JsonMapper.ToObject(result);
+            //{"info":"","data":[{"BrandName":"\u76D2\u6613\u4ED8","IconFileName":"hyf","SubData":{"\u73AF\u8FC5":"0","\u6613\u751F":"0","\u6D77\u79D1":"0","\u4E2D\u4ED8":"0"}}],"other":null,"status":"1","timestamp":0}
+            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())) });
         }
     }
 }