Commit 1ccd3043 by zhoujinhui

api跨域

parent 797fa862
...@@ -28,6 +28,6 @@ namespace Bailun.DC.Models.Common ...@@ -28,6 +28,6 @@ namespace Bailun.DC.Models.Common
/// <summary> /// <summary>
/// HTTP状态码 /// HTTP状态码
/// </summary> /// </summary>
public int Code { get; set; } public int Code => IsSuccess ? 200 : 0;
} }
} }
...@@ -54,5 +54,9 @@ and s2.company_type = @CorporateEntity"; ...@@ -54,5 +54,9 @@ and s2.company_type = @CorporateEntity";
return obj; return obj;
}; };
} }
#region 付现流水明细
#endregion
} }
} }
...@@ -42,5 +42,10 @@ namespace Bailun.DC.WebApi.Controllers ...@@ -42,5 +42,10 @@ namespace Bailun.DC.WebApi.Controllers
[HttpPost("getCashFlowStatement")] [HttpPost("getCashFlowStatement")]
public async Task<CommonApiResponseDto<List<dc_base_finance_fee>>> GetCashFlowStatement(GetCashFlowStatementInput input) public async Task<CommonApiResponseDto<List<dc_base_finance_fee>>> GetCashFlowStatement(GetCashFlowStatementInput input)
=> await new FinanceService().GetCashFlowStatement(input); => await new FinanceService().GetCashFlowStatement(input);
#region 付现流水明细
#endregion
} }
} }
...@@ -34,6 +34,7 @@ namespace Bailun.DC.WebApi ...@@ -34,6 +34,7 @@ namespace Bailun.DC.WebApi
{ {
ConfigManagerConf.SetConfiguration(Configuration); ConfigManagerConf.SetConfiguration(Configuration);
ConfigHelper.SetAppSetting(Configuration); ConfigHelper.SetAppSetting(Configuration);
services.AddCors(options =>options.AddPolicy("cors",p => p.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod().AllowCredentials()));
services.AddSwaggerGen(c => services.AddSwaggerGen(c =>
{ {
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Bailun.DC.WebApi", Version = "v1" }); c.SwaggerDoc("v1", new OpenApiInfo { Title = "Bailun.DC.WebApi", Version = "v1" });
...@@ -72,6 +73,7 @@ namespace Bailun.DC.WebApi ...@@ -72,6 +73,7 @@ namespace Bailun.DC.WebApi
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
app.UseCors("cors");
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI(c => app.UseSwaggerUI(c =>
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment