fix bug
This commit is contained in:
parent
a5a13f1297
commit
19665ba3f7
@ -24,11 +24,13 @@ namespace ZR.Admin.WebApi
|
|||||||
{
|
{
|
||||||
public class Startup
|
public class Startup
|
||||||
{
|
{
|
||||||
public Startup(IConfiguration configuration)
|
public Startup(IConfiguration configuration, IWebHostEnvironment hostEnvironment)
|
||||||
{
|
{
|
||||||
Configuration = configuration;
|
Configuration = configuration;
|
||||||
|
CurrentEnvironment = hostEnvironment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private IWebHostEnvironment CurrentEnvironment { get; }
|
||||||
public IConfiguration Configuration { get; }
|
public IConfiguration Configuration { get; }
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
@ -70,8 +72,11 @@ namespace ZR.Admin.WebApi
|
|||||||
services.AddSwaggerGen(c =>
|
services.AddSwaggerGen(c =>
|
||||||
{
|
{
|
||||||
c.SwaggerDoc("v1", new OpenApiInfo { Title = "ZrAdmin", Version = "v1" });
|
c.SwaggerDoc("v1", new OpenApiInfo { Title = "ZrAdmin", Version = "v1" });
|
||||||
//添加文档注释
|
if (CurrentEnvironment.IsDevelopment())
|
||||||
c.IncludeXmlComments("../ZRAdmin.xml", true);
|
{
|
||||||
|
//添加文档注释
|
||||||
|
c.IncludeXmlComments("ZRAdmin.xml", true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
<DocumentationFile>..\ZRAdmin.xml</DocumentationFile>
|
<DocumentationFile>ZRAdmin.xml</DocumentationFile>
|
||||||
<NoWarn>1701;1702;1591;1570</NoWarn>
|
<NoWarn>1701;1702;1591;1570</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user