我正在使用 ASP.NET Boilerplate 模板。我在让服务器接收我从 abp.ajax post 请求发送的数据时遇到问题(代码如下所示)。
控制台正在记录正确的数据(如屏幕截图 1 所示),但服务器未返回正确的数据。当我调试时,id 1000 的数据在服务器上显示为 0,即使控制台记录 1000 并且这就是发送的对象。
截图1:
Jquery:
$(document).on('click', '.default-customer-selection', function (e) {
e.preventDefault();
var info = {
toCustomerId: 1000 //Just trying to keep this simple for now
};
console.log(info);
abp.ajax({
url: abp.appPath + 'Portal/Catalog/SwitchCustomer',
data: JSON.stringify(info),
success: function (data) {
console.log('Data Returned: ' + data.personId);
}
});
});
Run Code Online (Sandbox Code Playgroud)
交换机客户的型号/DTO 输入:
using System;
using System.Collections.Generic;
using System.Text;
namespace MySolution.Catalog.Dtos
{
public class SwitchCustomerInput
{
public long ToCustomerId { get; set; …Run Code Online (Sandbox Code Playgroud)