(#18)万仕诚接口测试页面重写,返回正确响应头。

This commit is contained in:
falcon 2019-04-08 14:04:13 +08:00
parent 5b6455cb91
commit edb8eaa72e
2 changed files with 14 additions and 10 deletions

View File

@ -17,7 +17,7 @@ namespace Cmdjy.Controllers
public ActionResult Index() {
var model = new WsdRequest {
StartNo = "0",MaxCount = "10",
CompanyCode = "1",CompanyName = "万仕",
CompanyCode = "1",CompanyName = "万仕诚代煎药",
};
return PartialView(model);
}
@ -100,11 +100,15 @@ namespace Cmdjy.Controllers
result.More = db.PrescriptionInfos.Max(m => m.Id) > (start + count);
}
//编码json串 + 加密信息
//return Json(result);
var resStr = JsonConvert.SerializeObject(result);
var mw = noDes == null ? DesHelper.GetHelper().Encrypty(cKey,resStr) : resStr;
logWsdRequest(info,result,resStr,mw);
return Content(mw);
if(noDes == null) {
var resStr = JsonConvert.SerializeObject(result);
var mw = DesHelper.GetHelper().Encrypty(cKey,resStr);
logWsdRequest(info,result,resStr,mw);
return Content(mw);
}
else {
return Json(result,JsonRequestBehavior.AllowGet);
}
}
/// <summary>
/// 记录日志

View File

@ -22,11 +22,11 @@
<script type="text/javascript">
$("#wsdMsg").hide();
function wsdSucc(data) {
if (!data.match("^\{(.+:.+,*){1,}\}$")) {
$("#wsdMsg").show().text(data);
function wsdSucc(data, status, xhr) {
if (xhr.getResponseHeader("Content-Type").indexOf("application/json") >= 0) {
$("#wsdMsg").show().text(JSON.stringify(data, null, 2));
} else {
$("#wsdMsg").show().text(JSON.stringify(JSON.parse(data), null, 2));
$("#wsdMsg").show().text(data);
}
}
function wsdBeg() {