Open Jay413191 opened 2 years ago
请教大大,前后台程序如下,在执行时出现会出现Failed to load resource: the server responded with a status of 405 (Method Not Allowed) 请教要如何给参数才正确??
//前台呼叫 let url = "api/sales/getOrderDetail"; let data = { Export : false, Order : "ASC", Page : 1, Rows : 30, Sort : "OrderSNo", TableName : null, Total : 0, Value : null, Wheres : [{name:"OrderNo",value:"SA22050034",displayType:"like"}] }; this.http.get(url, data, true).then((result) => { let drow = result; });
//后台代码:查询订单明细返回销货单 [Route("getOrderDetail"), HttpPost] public IActionResult getOrderDetail([FromBody] PageDataOptions loadData) //loadData:请求的参数 { var gridData = _v_orderShippingDetailService.GetPageData(loadData); return JsonNormal(gridData); // JsonNormal可保持大小写不变 }
这个框架设计有点问题,这里改为这样 Wheres :JSON.stringify( [{name:"OrderNo",value:"SA22050034",displayType:"like"}])
请教大大,前后台程序如下,在执行时出现会出现Failed to load resource: the server responded with a status of 405 (Method Not Allowed) 请教要如何给参数才正确??
//前台呼叫 let url = "api/sales/getOrderDetail"; let data = { Export : false, Order : "ASC", Page : 1, Rows : 30, Sort : "OrderSNo", TableName : null, Total : 0, Value : null, Wheres : [{name:"OrderNo",value:"SA22050034",displayType:"like"}] }; this.http.get(url, data, true).then((result) => { let drow = result; });
//后台代码:查询订单明细返回销货单 [Route("getOrderDetail"), HttpPost] public IActionResult getOrderDetail([FromBody] PageDataOptions loadData) //loadData:请求的参数 { var gridData = _v_orderShippingDetailService.GetPageData(loadData); return JsonNormal(gridData); // JsonNormal可保持大小写不变 }