xsmax 拨号失败服务器无响应,加载资源失败:服务器响应状态为500(内部服务器错误)动态api...

跟进,而不是任务codeproject.com

我加入了简单的实体(客户端)的任务创建者的应用程序执行。

任务的显示工作正常。然而,当我尝试添加一个新的客户端似乎动态API是不可用,我收到以下错误:

811df8b3a729e8fdeba7fe1af37c21af.png ClientsController:

`[AbpMvcAuthorize] 公共类ClientsController:MyAppControllerBase 私有只读IClientAppService _clientService;

public ClientsController(IClientAppService clientService)

{

_clientService = clientService;

}

public async Task Index(GetAllClientsInput input)

{

var output = await _clientService.GetAll(input);

var model = new Web.Models.Clients.IndexViewModel(output.Items);

return View("Index", model);

}

public async Task Create(CreateClientInput input)

{

await _clientService.Create(input);

}

public async Task Delete(CreateClientInput input)

{

await _clientService.Create(input);

}

}`

Index.js:

(function() {

$(function() {

var _clientService = abp.services.app.client;

var _$modal = $('#ClientCreateModal');

var _$form = _$modal.find('form');

_$form.validate();

_$form.find('button[type="submit"]').click(function (e) {

e.preventDefault();

if (!_$form.valid()) {

return;

}

var client = _$form.serializeFormToObject(); //serializeFormToObject is defined in main.js

abp.ui.setBusy(_$modal);

_clientService.create(client).done(function() {

_$modal.modal('hide');

location.reload(true); //reload page to see new user!

}).always(function() {

abp.ui.clearBusy(_$modal);

});

});

_$modal.on('shown.bs.modal', function() {

_$modal.find('input:not([type=hidden]):first').focus();

});

});

})();

Index.cshtml

@section scripts

{

}

@L("Clients")

@L("UserName")@L("FullName")@L("EmailAddress")@L("IsActive")

@foreach (var user in Model.Clients)

{

@user.FirstName@user.LastName@user.Email@user.Mobile

}

add

客户服务:

[AbpAuthorize(PermissionNames.Pages_Tenants)]

public class ClientAppService : ApplicationService, IClientAppService

{

private readonly IRepository _clientRepository;

public ClientAppService(IRepository clientRepository)

{

_clientRepository = clientRepository;

}

public async Task> GetAll(GetAllClientsInput input)

{

var clients = await _clientRepository

.GetAll().ToListAsync();

return new ListResultDto(

ObjectMapper.Map>(clients));

}

public async Task Create(CreateClientInput input)

{

var task = ObjectMapper.Map(input);

await _clientRepository.InsertAsync(task);

}

}

服务器不被打到在所有的创建行动。

任何想法我失踪?

2017-10-07

akd

+0

您可以检查错误日志中'* .Web.Mvc \ App_Data文件\ Logs'? –

+0

非常感谢。日志文件告诉了很多。客户端实现IMustHaveTenant。并且当我以主机用户的身份登录时,错误显示“无法为IMustHaveTenant实体将TenantId设置为0!”我希望我能看到该警告,而不是发生内部服务器错误! –

+0

那么,这是一个编程错误,客户端不应该可见。 –

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值