예제 #1
0
        public ActionResult AjaxPostCorssDomain([FromBody] AjaxPostParam postParam)
        {
            string url = postParam.url; string json = postParam.json;

            try
            {
                var _result     = PostHelper.GetPostResult(url, json);
                var json_result = Json(_result);
                return(json_result);
                //var result = ApiJsonHelper.LargeJson(_result);
                //return result;
            }
            catch (Exception ex)
            {
                //用log4net记录日志
                _Log4Net.Error("AjaxPostCorssDomain." + url + "." + json, ex);

                //Logger.Default.Error("AjaxPostCorssDomain异常:{0}", ex);
                return(Json(JsonConvert.SerializeObject(new ResultParam
                {
                    IsSuccess = false,
                    AlertMessage = JsonConvert.SerializeObject(ex),
                })));
            }
        }
예제 #2
0
        protected ActionResult AjaxPostCorssDomain(string url, string json)
        {
            try
            {
                var _result = PostHelper.GetPostResult(url, json);
                return(JsonHelper.LargeJson(_result));
            }
            catch (Exception ex)
            {
                //用log4net记录日志
                _Log4Net.Error("AjaxPostCorssDomain." + url + "." + json, ex);

                // Logger.Default.Error("AjaxPostCorssDomain异常:{0}", ex);
                return(Json(JsonConvert.SerializeObject(new ResultParam
                {
                    IsSuccess = false,
                    AlertMessage = JsonConvert.SerializeObject(ex),
                })));
            }
        }