From 73d62e56a2d7a75c8c0de90f39bcd8df1924bdcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Tue, 21 Dec 2021 17:59:12 +0800 Subject: [PATCH] =?UTF-8?q?fix=20swagger=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Controllers/CommonController.cs | 1 + ZR.Admin.WebApi/Startup.cs | 6 +----- ZR.Vue/src/views/tool/swagger/index.vue | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/CommonController.cs b/ZR.Admin.WebApi/Controllers/CommonController.cs index b2b940f..49f68a9 100644 --- a/ZR.Admin.WebApi/Controllers/CommonController.cs +++ b/ZR.Admin.WebApi/Controllers/CommonController.cs @@ -46,6 +46,7 @@ namespace ZR.Admin.WebApi.Controllers } [Route("/")] + [HttpGet] public IActionResult Index() { return Content("Hello看到这里页面说明你已经成功启动了本项目,加油吧 少年。"); diff --git a/ZR.Admin.WebApi/Startup.cs b/ZR.Admin.WebApi/Startup.cs index e8b4b86..e7bab74 100644 --- a/ZR.Admin.WebApi/Startup.cs +++ b/ZR.Admin.WebApi/Startup.cs @@ -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")); //ʹԶζȥbody app.Use((context, next) => diff --git a/ZR.Vue/src/views/tool/swagger/index.vue b/ZR.Vue/src/views/tool/swagger/index.vue index c6ca3b4..9895464 100644 --- a/ZR.Vue/src/views/tool/swagger/index.vue +++ b/ZR.Vue/src/views/tool/swagger/index.vue @@ -8,7 +8,7 @@ export default { name: "Swagger", data() { return { - src: process.env.VUE_APP_BASE_API + "swagger/index.html", + src: process.env.VUE_APP_BASE_API + "/swagger/index.html", height: document.documentElement.clientHeight - 94.5 + "px;", loading: true };