From d288aa43cf867b2c3654958875ced0b6e800dff7 Mon Sep 17 00:00:00 2001 From: wanggaofeng <15601716045@163.com> Date: Tue, 25 Jun 2024 21:17:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Docs/项目说明.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Docs/项目说明.md b/Docs/项目说明.md index 92aa40a..e221e44 100644 --- a/Docs/项目说明.md +++ b/Docs/项目说明.md @@ -18,16 +18,17 @@ //或者MapGet方法 //老版本写法 - app.UseEndpoints(endpoints => + app.UseEndpoints(endpoints => { - app.Map("/",async context => - { - context.Response.Redirect("swagger/index.html"); - await Task.CompletedTask; - }); - }); + //默认打开Swagger + endpoints.Map("/", async context => + { + context.Response.Redirect($"{context.Request.PathBase}/swagger/index.html"); + await Task.CompletedTask; + }); + }); ``` - + + 路由+自定义内容 ```csharp