fix swagger报错

This commit is contained in:
不做码农
2021-12-21 17:59:12 +08:00
parent f2c83958b4
commit 73d62e56a2
3 changed files with 3 additions and 6 deletions

View File

@@ -46,6 +46,7 @@ namespace ZR.Admin.WebApi.Controllers
}
[Route("/")]
[HttpGet]
public IActionResult Index()
{
return Content("Hello看到这里页面说明你已经成功启动了本项目加油吧 少年。");

View File

@@ -1,19 +1,15 @@
using Hei.Captcha;
using Infrastructure;
using Infrastructure.Extensions;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.OpenApi.Models;
using SqlSugar.IOC;
using Swashbuckle.AspNetCore.Filters;
using System;
using System.Collections.Generic;
using System.IO;
@@ -98,7 +94,7 @@ namespace ZR.Admin.WebApi
app.UseDeveloperExceptionPage();
}
app.UseSwagger();
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "ZrAdmin v1"));
app.UseSwaggerUI(c => c.SwaggerEndpoint("v1/swagger.json", "ZrAdmin v1"));
//ʹ<><CAB9><EFBFBD>Զ<EFBFBD><D4B6>ζ<EFBFBD>ȥbody<64><79><EFBFBD><EFBFBD>
app.Use((context, next) =>