committed by
GitHub
21 changed files with 79 additions and 28 deletions
@ -0,0 +1,27 @@ |
|||||
|
using System; |
||||
|
using Microsoft.AspNetCore.Builder; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using Swashbuckle.AspNetCore.SwaggerUI; |
||||
|
using Volo.Abp.Swashbuckle; |
||||
|
|
||||
|
namespace EShopOnAbp.Shared.Hosting.AspNetCore; |
||||
|
|
||||
|
public static class AbpSwaggerUIBuilderExtensions |
||||
|
{ |
||||
|
public static IApplicationBuilder UseAbpSwaggerWithCustomScriptUI( |
||||
|
this IApplicationBuilder app, |
||||
|
Action<SwaggerUIOptions>? setupAction = null) |
||||
|
{ |
||||
|
var resolver = app.ApplicationServices.GetService<ISwaggerHtmlResolver>(); |
||||
|
|
||||
|
return app.UseSwaggerUI(options => |
||||
|
{ |
||||
|
options.InjectJavascript("ui/abp.js"); |
||||
|
options.InjectJavascript("ui/abp.swagger.js"); |
||||
|
options.InjectJavascript("ui/requestinterceptor.js"); |
||||
|
options.IndexStream = () => resolver?.Resolver(); |
||||
|
|
||||
|
setupAction?.Invoke(options); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
const originalFetch = window.fetch; |
||||
|
|
||||
|
window.fetch = function (input, init) { |
||||
|
if (init !== undefined && init.headers['RequestVerificationToken'] !== undefined) { |
||||
|
delete init.headers['RequestVerificationToken']; |
||||
|
} |
||||
|
|
||||
|
return originalFetch.apply(this, arguments); |
||||
|
}; |
||||
Loading…
Reference in new issue