提交管理员操作一切
This commit is contained in:
1 parent
a87ebeaffb
commit
d6471f97d3
23 files changed
+600
-73
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using Asp.Versioning;
|
||||
using Asp.Versioning.OpenApi;
|
||||
using MAX.Framework.Conventions;
|
||||
using MAX.Framework.DependencyInjection;
|
||||
using Scalar.AspNetCore;
|
||||
@@ -39,6 +40,18 @@ public partial class Program
|
||||
options.GroupNameFormat = "'v'VVV";
|
||||
options.SubstituteApiVersionInUrl = true;
|
||||
}).AddOpenApi();
|
||||
builder.Services.Configure<VersionedOpenApiOptions>(options =>
|
||||
{
|
||||
options.Document.AddDocumentTransformer((document, _, _) =>
|
||||
{
|
||||
// 接口路径以 / 开头,服务器地址不保留尾部斜杠,兼容导入工具直接拼接 URL。
|
||||
foreach (var server in document.Servers ?? [])
|
||||
{
|
||||
server.Url = server.Url?.TrimEnd('/');
|
||||
}
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
WebApplication app = builder.Build();
|
||||
|
||||
Reference in new issue
Block a user