Skip to content

Commit e204bc4

Browse files
author
LemonNoCry
committed
✨ 优化Swagger:增加令牌本地缓存 reload不会丢失
1 parent 698e264 commit e204bc4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Blog.Core.Extensions/Middlewares/SwaggerMiddleware.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public static void UseSwaggerMiddle(this IApplicationBuilder app, Func<Stream> s
4343
c.OAuthClientId("blogadminjs");
4444
}
4545

46+
//增加令牌本地缓存 reload不会丢失
47+
c.ConfigObject.AdditionalItems.Add("persistAuthorization","true");
4648

4749
// 路径配置,设置为空,表示直接在根域名(localhost:8001)访问该文件,注意localhost:8001/swagger是访问不到的,去launchSettings.json把launchUrl去掉,如果你想换一个路径,直接写名字即可,比如直接写c.RoutePrefix = "doc";
4850
c.RoutePrefix = "";

0 commit comments

Comments
 (0)