such as the title: I need to request an interface on my page:
$.get(url, data, function (res) {
if (res.Code == 100) {
//...
} else {
//...
}
})
//-1
later, some people said that it was a cross-domain problem. With the mentality of giving it a try, Baidu made the following changes:
$.ajax({
type:"get",
url:url,
dataType:"jsonp",
jsonpCallback:"cb",
success:function(){
//...
}
});
//-1
I debugged the breakpoint and found that the interface in the console has been successfully called and the parameters passed are as expected. However, when the colleague in the background debugged the interface at the same time, he found that he did not enter the corresponding controller. An exception was thrown directly, and I didn"t understand what the problem was. Ask the master to advise Orz!
add this interface code in the background:
public JsonResult QueryActivityList(int status,int pageIndex,int pageSize)
{
try
{
var result = ComssionActivityBLL.Instance.QueryData(UserContext.CurrentStore.ID, status, pageIndex, pageSize);
return Json(Repost.Return(result), JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
return Json(Repost.SysError(), JsonRequestBehavior.AllowGet);
}
}
catch