问题描述
我的应用程序正常运行。当工作室正在工作时,我的电脑突然关闭后,发布请求不再起作用。获取请求有效,但不发布。我不明白为什么这样。下面的代码是控制器。在调试模式下,请不要输入。
[HttpPost]
[Route("Login")]
public ActionResult Post(PA_Users login)
{
var user = repo.Login(login);
return Ok(new { Result = user,Status = "SUCCESS" });
}
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<IConfig,Config>();
services.AddScoped<BaseRepository,BaseRepository>();
services.AddScoped<LoggerService,LoggerService>();
services.AddScoped<ExcellService,ExcellService>();
services.AddScoped<HelperService,HelperService>();
services.AddScoped<EmailService,EmailService>();
services.AddScoped<PA_UserRepository,PA_UserRepository>();
services.AddScoped<AdminRepository,AdminRepository>();
services.AddScoped<OxygenRepository,OxygenRepository>();
services.AddScoped<PA_ItemRepository,PA_ItemRepository>();
services.AddScoped<PA_InteraktifRepository,PA_InteraktifRepository>();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1",new Info { Title = "My API",Version = "v1" });
});
services.AddCors(options =>
{
options.AddPolicy("CorsPolicy",builder => builder.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials()
);
});
services.AddSignalR().AddJsonProtocol(options =>
{
options.PayloadSerializerSettings.ContractResolver = new DefaultContractResolver();
});
services.AddMvc().AddJsonoptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());
}
什么可能是导致此问题的原因。预先感谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)