From 704fd816e35d3d7d4c22dc4d0e13fa15eae4acec Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 21 Feb 2024 16:47:04 -0500 Subject: [PATCH 1/3] Updated swagger client --- .../web-public/src/EShopOnAbp.WebPublicGateway/appsettings.json | 2 +- gateways/web/src/EShopOnAbp.WebGateway/appsettings.json | 2 +- services/basket/src/EShopOnAbp.BasketService/appsettings.json | 2 +- .../src/EShopOnAbp.CatalogService.HttpApi.Host/appsettings.json | 2 +- .../src/EShopOnAbp.CmskitService.HttpApi.Host/appsettings.json | 2 +- .../EShopOnAbp.IdentityService.HttpApi.Host/appsettings.json | 2 +- .../EShopOnAbp.OrderingService.HttpApi.Host/appsettings.json | 2 +- .../src/EShopOnAbp.PaymentService.HttpApi.Host/appsettings.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.json b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.json index 60ed6166..e1e08219 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.json +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/appsettings.json @@ -7,7 +7,7 @@ "AuthServer": { "Authority": "http://localhost:8080/realms/master", "RequireHttpsMetadata": "true", - "SwaggerClientId": "WebGateway_Swagger", + "SwaggerClientId": "SwaggerClient", "SwaggerClientSecret": "1q2w3e*" }, "Logging": { diff --git a/gateways/web/src/EShopOnAbp.WebGateway/appsettings.json b/gateways/web/src/EShopOnAbp.WebGateway/appsettings.json index 00dde9fb..487b5e11 100644 --- a/gateways/web/src/EShopOnAbp.WebGateway/appsettings.json +++ b/gateways/web/src/EShopOnAbp.WebGateway/appsettings.json @@ -8,7 +8,7 @@ "Authority": "http://localhost:8080/realms/master", "RequireHttpsMetadata": "true", "MetadataAddress": "http://localhost:8080/realms/master", - "SwaggerClientId": "WebGateway_Swagger" + "SwaggerClientId": "SwaggerClient" }, "Logging": { "LogLevel": { diff --git a/services/basket/src/EShopOnAbp.BasketService/appsettings.json b/services/basket/src/EShopOnAbp.BasketService/appsettings.json index 848af7b7..e1922980 100644 --- a/services/basket/src/EShopOnAbp.BasketService/appsettings.json +++ b/services/basket/src/EShopOnAbp.BasketService/appsettings.json @@ -7,7 +7,7 @@ "Authority": "http://localhost:8080/realms/master", "RequireHttpsMetadata": "false", "MetadataAddress": "http://localhost:8080/realms/master", - "SwaggerClientId": "WebGateway_Swagger" + "SwaggerClientId": "SwaggerClient" }, "RemoteServices": { "Catalog": { diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/appsettings.json b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/appsettings.json index a36a8c76..9fdb84ca 100644 --- a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/appsettings.json +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/appsettings.json @@ -7,7 +7,7 @@ "Authority": "http://localhost:8080/realms/master", "RequireHttpsMetadata": "false", "MetadataAddress": "http://localhost:8080/realms/master", - "SwaggerClientId": "WebGateway_Swagger" + "SwaggerClientId": "SwaggerClient" }, "Logging": { "LogLevel": { diff --git a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/appsettings.json b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/appsettings.json index 1d6763a6..3590e555 100644 --- a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/appsettings.json +++ b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/appsettings.json @@ -7,7 +7,7 @@ "Authority": "http://localhost:8080/realms/master", "RequireHttpsMetadata": "false", "MetadataAddress": "http://localhost:8080/realms/master", - "SwaggerClientId": "WebGateway_Swagger" + "SwaggerClientId": "SwaggerClient" }, "Logging": { "LogLevel": { diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.json b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.json index 8b7c19da..fe016048 100644 --- a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.json +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/appsettings.json @@ -7,7 +7,7 @@ "Authority": "http://localhost:8080/realms/master", "RequireHttpsMetadata": "false", "MetadataAddress": "http://localhost:8080/realms/master", - "SwaggerClientId": "WebGateway_Swagger" + "SwaggerClientId": "SwaggerClient" }, "Keycloak": { "url": "http://localhost:8080", diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/appsettings.json b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/appsettings.json index aa730d23..d15531c8 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/appsettings.json +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/appsettings.json @@ -7,7 +7,7 @@ "Authority": "http://localhost:8080/realms/master", "RequireHttpsMetadata": "false", "MetadataAddress": "http://localhost:8080/realms/master", - "SwaggerClientId": "WebGateway_Swagger" + "SwaggerClientId": "SwaggerClient" }, "Logging": { "LogLevel": { diff --git a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/appsettings.json b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/appsettings.json index 0962ca7e..7624b30e 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/appsettings.json +++ b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/appsettings.json @@ -7,7 +7,7 @@ "Authority": "http://localhost:8080/realms/master", "RequireHttpsMetadata": "false", "MetadataAddress": "http://localhost:8080/realms/master", - "SwaggerClientId": "WebGateway_Swagger" + "SwaggerClientId": "SwaggerClient" }, "Logging": { "LogLevel": { From 985d2e427cf1068dee7ef4915e96b919e0b38f6d Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 21 Feb 2024 16:47:39 -0500 Subject: [PATCH 2/3] Added request-interceptor to remove RequestVerificationToken --- .../EShopOnAbp.WebPublicGateway.csproj | 5 ++++ .../wwwroot/swagger/ui/requestinterceptor.js | 9 +++++++ .../EShopOnAbp.WebGateway.csproj | 5 ++++ .../wwwroot/swagger/ui/requestinterceptor.js | 9 +++++++ .../AdministrationServiceHttpApiHostModule.cs | 16 ++++------- ....AdministrationService.HttpApi.Host.csproj | 5 ++++ .../wwwroot/swagger/ui/requestinterceptor.js | 9 +++++++ .../BasketServiceModule.cs | 2 +- .../EShopOnAbp.BasketService.csproj | 5 ++++ .../wwwroot/swagger/ui/requestinterceptor.js | 9 +++++++ .../CatalogServiceHttpApiHostModule.cs | 2 +- ...opOnAbp.CatalogService.HttpApi.Host.csproj | 5 ++++ .../wwwroot/swagger/ui/requestinterceptor.js | 9 +++++++ .../CmskitServiceHttpApiHostModule.cs | 2 +- ...hopOnAbp.CmskitService.HttpApi.Host.csproj | 5 ++++ .../wwwroot/swagger/ui/requestinterceptor.js | 9 +++++++ ...pOnAbp.IdentityService.HttpApi.Host.csproj | 6 +++++ .../IdentityServiceHttpApiHostModule.cs | 5 ++-- .../wwwroot/swagger/ui/requestinterceptor.js | 9 +++++++ ...pOnAbp.OrderingService.HttpApi.Host.csproj | 5 ++++ .../OrderingServiceHttpApiHostModule.cs | 2 +- .../wwwroot/swagger/ui/requestinterceptor.js | 9 +++++++ ...opOnAbp.PaymentService.HttpApi.Host.csproj | 5 ++++ .../PaymentServiceHttpApiHostModule.cs | 2 +- .../wwwroot/swagger/ui/requestinterceptor.js | 9 +++++++ .../AbpSwaggerUIBuilderExtensions.cs | 27 +++++++++++++++++++ ...ShopOnAbp.Shared.Hosting.AspNetCore.csproj | 4 +++ ...EShopOnAbpSharedHostingAspNetCoreModule.cs | 3 --- .../YarpSwaggerUIBuilderExtensions.cs | 3 ++- 29 files changed, 172 insertions(+), 23 deletions(-) create mode 100644 gateways/web-public/src/EShopOnAbp.WebPublicGateway/wwwroot/swagger/ui/requestinterceptor.js create mode 100644 gateways/web/src/EShopOnAbp.WebGateway/wwwroot/swagger/ui/requestinterceptor.js create mode 100644 services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js create mode 100644 services/basket/src/EShopOnAbp.BasketService/wwwroot/swagger/ui/requestinterceptor.js create mode 100644 services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js create mode 100644 services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js create mode 100644 services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js create mode 100644 services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js create mode 100644 services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js create mode 100644 shared/EShopOnAbp.Shared.Hosting.AspNetCore/AbpSwaggerUIBuilderExtensions.cs diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj index b5f35155..5c6e4325 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj @@ -15,4 +15,9 @@ + + + + + diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/wwwroot/swagger/ui/requestinterceptor.js b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/wwwroot/swagger/ui/requestinterceptor.js new file mode 100644 index 00000000..963782ee --- /dev/null +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/wwwroot/swagger/ui/requestinterceptor.js @@ -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); +}; \ No newline at end of file diff --git a/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj b/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj index b5f35155..5c6e4325 100644 --- a/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj +++ b/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj @@ -15,4 +15,9 @@ + + + + + diff --git a/gateways/web/src/EShopOnAbp.WebGateway/wwwroot/swagger/ui/requestinterceptor.js b/gateways/web/src/EShopOnAbp.WebGateway/wwwroot/swagger/ui/requestinterceptor.js new file mode 100644 index 00000000..963782ee --- /dev/null +++ b/gateways/web/src/EShopOnAbp.WebGateway/wwwroot/swagger/ui/requestinterceptor.js @@ -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); +}; \ No newline at end of file diff --git a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/AdministrationServiceHttpApiHostModule.cs b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/AdministrationServiceHttpApiHostModule.cs index bc61eb04..d823f511 100644 --- a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/AdministrationServiceHttpApiHostModule.cs +++ b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/AdministrationServiceHttpApiHostModule.cs @@ -59,17 +59,11 @@ public override void ConfigureServices(ServiceConfigurationContext context) .AllowCredentials(); }); }); - - Configure(options => - { - options.IsDynamicPermissionStoreEnabled = true; - }); - Configure(options => - { - options.IsDynamicSettingStoreEnabled = true; - }); - + Configure(options => { options.IsDynamicPermissionStoreEnabled = true; }); + + Configure(options => { options.IsDynamicSettingStoreEnabled = true; }); + // Configure(options => // { // options.ValueProviders.Clear(); @@ -99,7 +93,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex app.UseUnitOfWork(); app.UseAuthorization(); app.UseSwagger(); - app.UseAbpSwaggerUI(options => + app.UseAbpSwaggerWithCustomScriptUI(options => { var configuration = context.ServiceProvider.GetRequiredService(); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Administration Service API"); diff --git a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj index 394141c4..140fcc02 100644 --- a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj +++ b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj @@ -33,4 +33,9 @@ + + + + + diff --git a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js new file mode 100644 index 00000000..963782ee --- /dev/null +++ b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js @@ -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); +}; \ No newline at end of file diff --git a/services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs b/services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs index 92adfd78..29c769df 100644 --- a/services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs +++ b/services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs @@ -95,7 +95,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex app.UseAbpClaimsMap(); app.UseAuthorization(); app.UseSwagger(); - app.UseAbpSwaggerUI(options => + app.UseAbpSwaggerWithCustomScriptUI(options => { var configuration = context.ServiceProvider.GetRequiredService(); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Basket Service API"); diff --git a/services/basket/src/EShopOnAbp.BasketService/EShopOnAbp.BasketService.csproj b/services/basket/src/EShopOnAbp.BasketService/EShopOnAbp.BasketService.csproj index 866a430d..fce71f6c 100644 --- a/services/basket/src/EShopOnAbp.BasketService/EShopOnAbp.BasketService.csproj +++ b/services/basket/src/EShopOnAbp.BasketService/EShopOnAbp.BasketService.csproj @@ -44,4 +44,9 @@ + + + + + diff --git a/services/basket/src/EShopOnAbp.BasketService/wwwroot/swagger/ui/requestinterceptor.js b/services/basket/src/EShopOnAbp.BasketService/wwwroot/swagger/ui/requestinterceptor.js new file mode 100644 index 00000000..963782ee --- /dev/null +++ b/services/basket/src/EShopOnAbp.BasketService/wwwroot/swagger/ui/requestinterceptor.js @@ -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); +}; \ No newline at end of file diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/CatalogServiceHttpApiHostModule.cs b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/CatalogServiceHttpApiHostModule.cs index 410e55aa..cd0e3cba 100644 --- a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/CatalogServiceHttpApiHostModule.cs +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/CatalogServiceHttpApiHostModule.cs @@ -101,7 +101,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex app.UseAbpClaimsMap(); app.UseAuthorization(); app.UseSwagger(); - app.UseAbpSwaggerUI(options => + app.UseAbpSwaggerWithCustomScriptUI(options => { var configuration = context.ServiceProvider.GetRequiredService(); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Catalog Service API"); diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj index 706f800e..4228481b 100644 --- a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj @@ -30,6 +30,11 @@ + + + + + diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js new file mode 100644 index 00000000..963782ee --- /dev/null +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js @@ -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); +}; \ No newline at end of file diff --git a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/CmskitServiceHttpApiHostModule.cs b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/CmskitServiceHttpApiHostModule.cs index 120af667..9a21f3ae 100644 --- a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/CmskitServiceHttpApiHostModule.cs +++ b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/CmskitServiceHttpApiHostModule.cs @@ -111,7 +111,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex app.UseAbpClaimsMap(); app.UseAuthorization(); app.UseSwagger(); - app.UseAbpSwaggerUI(options => + app.UseAbpSwaggerWithCustomScriptUI(options => { var configuration = context.ServiceProvider.GetRequiredService(); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Cmskit Service API"); diff --git a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/EShopOnAbp.CmskitService.HttpApi.Host.csproj b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/EShopOnAbp.CmskitService.HttpApi.Host.csproj index 856c7143..7f715491 100644 --- a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/EShopOnAbp.CmskitService.HttpApi.Host.csproj +++ b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/EShopOnAbp.CmskitService.HttpApi.Host.csproj @@ -32,4 +32,9 @@ + + + + + diff --git a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js new file mode 100644 index 00000000..963782ee --- /dev/null +++ b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js @@ -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); +}; \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj index df7b860b..5de66493 100644 --- a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj @@ -3,6 +3,7 @@ net8.0 EShopOnAbp.IdentityService + true @@ -26,5 +27,10 @@ + + + + + diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs index 66bd0070..489741fe 100644 --- a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs @@ -22,8 +22,7 @@ namespace EShopOnAbp.IdentityService; typeof(EShopOnAbpSharedHostingMicroservicesModule), typeof(IdentityServiceHttpApiModule), typeof(IdentityServiceApplicationModule), - typeof(IdentityServiceEntityFrameworkCoreModule), - typeof(EShopOnAbpSharedHostingGatewaysModule) + typeof(IdentityServiceEntityFrameworkCoreModule) )] public class IdentityServiceHttpApiHostModule : AbpModule { @@ -91,7 +90,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex app.UseAbpClaimsMap(); app.UseAuthorization(); app.UseSwagger(); - app.UseAbpSwaggerUI(options => + app.UseAbpSwaggerWithCustomScriptUI(options => { var configuration = context.ServiceProvider.GetRequiredService(); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Identity Service API"); diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js new file mode 100644 index 00000000..963782ee --- /dev/null +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js @@ -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); +}; \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj index 5415c2bd..19f80c0e 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj @@ -31,4 +31,9 @@ + + + + + diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs index be9910c9..1ba22f30 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs @@ -88,7 +88,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex app.UseAbpClaimsMap(); app.UseAuthorization(); app.UseSwagger(); - app.UseAbpSwaggerUI(options => + app.UseAbpSwaggerWithCustomScriptUI(options => { var configuration = context.ServiceProvider.GetRequiredService(); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Ordering Service API"); diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js new file mode 100644 index 00000000..963782ee --- /dev/null +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js @@ -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); +}; \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj index b4607f89..7ac859a9 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj +++ b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj @@ -26,4 +26,9 @@ + + + + + diff --git a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/PaymentServiceHttpApiHostModule.cs b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/PaymentServiceHttpApiHostModule.cs index 953d02cf..59767643 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/PaymentServiceHttpApiHostModule.cs +++ b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/PaymentServiceHttpApiHostModule.cs @@ -81,7 +81,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex app.UseAbpClaimsMap(); app.UseAuthorization(); app.UseSwagger(); - app.UseAbpSwaggerUI(options => + app.UseAbpSwaggerWithCustomScriptUI(options => { var configuration = context.ServiceProvider.GetRequiredService(); options.SwaggerEndpoint("/swagger/v1/swagger.json", "Payment Service API"); diff --git a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js new file mode 100644 index 00000000..963782ee --- /dev/null +++ b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js @@ -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); +}; \ No newline at end of file diff --git a/shared/EShopOnAbp.Shared.Hosting.AspNetCore/AbpSwaggerUIBuilderExtensions.cs b/shared/EShopOnAbp.Shared.Hosting.AspNetCore/AbpSwaggerUIBuilderExtensions.cs new file mode 100644 index 00000000..0cf25f81 --- /dev/null +++ b/shared/EShopOnAbp.Shared.Hosting.AspNetCore/AbpSwaggerUIBuilderExtensions.cs @@ -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? setupAction = null) + { + var resolver = app.ApplicationServices.GetService(); + + 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); + }); + } +} \ No newline at end of file diff --git a/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj b/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj index 65802e99..8a0b5e53 100644 --- a/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj +++ b/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj @@ -17,4 +17,8 @@ + + + + diff --git a/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbpSharedHostingAspNetCoreModule.cs b/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbpSharedHostingAspNetCoreModule.cs index 0c71d886..7e3b8d8d 100644 --- a/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbpSharedHostingAspNetCoreModule.cs +++ b/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbpSharedHostingAspNetCoreModule.cs @@ -12,7 +12,4 @@ namespace EShopOnAbp.Shared.Hosting.AspNetCore; )] public class EShopOnAbpSharedHostingAspNetCoreModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - } } \ No newline at end of file diff --git a/shared/EShopOnAbp.Shared.Hosting.Gateways/YarpSwaggerUIBuilderExtensions.cs b/shared/EShopOnAbp.Shared.Hosting.Gateways/YarpSwaggerUIBuilderExtensions.cs index ad54e1da..9dab2860 100644 --- a/shared/EShopOnAbp.Shared.Hosting.Gateways/YarpSwaggerUIBuilderExtensions.cs +++ b/shared/EShopOnAbp.Shared.Hosting.Gateways/YarpSwaggerUIBuilderExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using EShopOnAbp.Shared.Hosting.AspNetCore; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -15,7 +16,7 @@ public static IApplicationBuilder UseSwaggerUIWithYarp(this IApplicationBuilder ApplicationInitializationContext context) { app.UseSwagger(); - app.UseAbpSwaggerUI(options => + app.UseAbpSwaggerWithCustomScriptUI(options => { var configuration = context.ServiceProvider.GetRequiredService(); var logger = context.ServiceProvider.GetRequiredService>(); From 8e1407539e2ecfb447bce20dde11e4ec958abfb0 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 21 Feb 2024 21:11:31 -0500 Subject: [PATCH 3/3] moved the interceptor script to shared.hosting.aspnetcore --- .../EShopOnAbp.WebPublicGateway.csproj | 5 ----- .../EShopOnAbp.WebGateway.csproj | 5 ----- .../wwwroot/swagger/ui/requestinterceptor.js | 9 --------- ...hopOnAbp.AdministrationService.HttpApi.Host.csproj | 5 ----- .../wwwroot/swagger/ui/requestinterceptor.js | 9 --------- .../EShopOnAbp.BasketService.csproj | 5 ----- .../wwwroot/swagger/ui/requestinterceptor.js | 9 --------- .../EShopOnAbp.CatalogService.HttpApi.Host.csproj | 5 ----- .../wwwroot/swagger/ui/requestinterceptor.js | 9 --------- .../EShopOnAbp.CmskitService.HttpApi.Host.csproj | 5 ----- .../wwwroot/swagger/ui/requestinterceptor.js | 9 --------- .../EShopOnAbp.IdentityService.HttpApi.Host.csproj | 5 ----- .../wwwroot/swagger/ui/requestinterceptor.js | 9 --------- .../EShopOnAbp.OrderingService.HttpApi.Host.csproj | 5 ----- .../wwwroot/swagger/ui/requestinterceptor.js | 9 --------- .../EShopOnAbp.PaymentService.HttpApi.Host.csproj | 5 ----- .../wwwroot/swagger/ui/requestinterceptor.js | 9 --------- .../EShopOnAbp.Shared.Hosting.AspNetCore.csproj | 11 +++++++++++ .../EShopOnAbpSharedHostingAspNetCoreModule.cs | 8 ++++++++ .../wwwroot/swagger/ui/requestinterceptor.js | 0 20 files changed, 19 insertions(+), 117 deletions(-) delete mode 100644 gateways/web/src/EShopOnAbp.WebGateway/wwwroot/swagger/ui/requestinterceptor.js delete mode 100644 services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js delete mode 100644 services/basket/src/EShopOnAbp.BasketService/wwwroot/swagger/ui/requestinterceptor.js delete mode 100644 services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js delete mode 100644 services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js delete mode 100644 services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js delete mode 100644 services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js delete mode 100644 services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js rename {gateways/web-public/src/EShopOnAbp.WebPublicGateway => shared/EShopOnAbp.Shared.Hosting.AspNetCore}/wwwroot/swagger/ui/requestinterceptor.js (100%) diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj index 5c6e4325..b5f35155 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbp.WebPublicGateway.csproj @@ -15,9 +15,4 @@ - - - - - diff --git a/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj b/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj index 5c6e4325..b5f35155 100644 --- a/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj +++ b/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbp.WebGateway.csproj @@ -15,9 +15,4 @@ - - - - - diff --git a/gateways/web/src/EShopOnAbp.WebGateway/wwwroot/swagger/ui/requestinterceptor.js b/gateways/web/src/EShopOnAbp.WebGateway/wwwroot/swagger/ui/requestinterceptor.js deleted file mode 100644 index 963782ee..00000000 --- a/gateways/web/src/EShopOnAbp.WebGateway/wwwroot/swagger/ui/requestinterceptor.js +++ /dev/null @@ -1,9 +0,0 @@ -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); -}; \ No newline at end of file diff --git a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj index 140fcc02..394141c4 100644 --- a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj +++ b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/EShopOnAbp.AdministrationService.HttpApi.Host.csproj @@ -33,9 +33,4 @@ - - - - - diff --git a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js b/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js deleted file mode 100644 index 963782ee..00000000 --- a/services/administration/src/EShopOnAbp.AdministrationService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js +++ /dev/null @@ -1,9 +0,0 @@ -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); -}; \ No newline at end of file diff --git a/services/basket/src/EShopOnAbp.BasketService/EShopOnAbp.BasketService.csproj b/services/basket/src/EShopOnAbp.BasketService/EShopOnAbp.BasketService.csproj index fce71f6c..866a430d 100644 --- a/services/basket/src/EShopOnAbp.BasketService/EShopOnAbp.BasketService.csproj +++ b/services/basket/src/EShopOnAbp.BasketService/EShopOnAbp.BasketService.csproj @@ -44,9 +44,4 @@ - - - - - diff --git a/services/basket/src/EShopOnAbp.BasketService/wwwroot/swagger/ui/requestinterceptor.js b/services/basket/src/EShopOnAbp.BasketService/wwwroot/swagger/ui/requestinterceptor.js deleted file mode 100644 index 963782ee..00000000 --- a/services/basket/src/EShopOnAbp.BasketService/wwwroot/swagger/ui/requestinterceptor.js +++ /dev/null @@ -1,9 +0,0 @@ -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); -}; \ No newline at end of file diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj index 4228481b..706f800e 100644 --- a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/EShopOnAbp.CatalogService.HttpApi.Host.csproj @@ -30,11 +30,6 @@ - - - - - diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js deleted file mode 100644 index 963782ee..00000000 --- a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js +++ /dev/null @@ -1,9 +0,0 @@ -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); -}; \ No newline at end of file diff --git a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/EShopOnAbp.CmskitService.HttpApi.Host.csproj b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/EShopOnAbp.CmskitService.HttpApi.Host.csproj index 7f715491..856c7143 100644 --- a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/EShopOnAbp.CmskitService.HttpApi.Host.csproj +++ b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/EShopOnAbp.CmskitService.HttpApi.Host.csproj @@ -32,9 +32,4 @@ - - - - - diff --git a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js deleted file mode 100644 index 963782ee..00000000 --- a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js +++ /dev/null @@ -1,9 +0,0 @@ -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); -}; \ No newline at end of file diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj index 5de66493..03de9037 100644 --- a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/EShopOnAbp.IdentityService.HttpApi.Host.csproj @@ -27,10 +27,5 @@ - - - - - diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js deleted file mode 100644 index 963782ee..00000000 --- a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js +++ /dev/null @@ -1,9 +0,0 @@ -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); -}; \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj index 19f80c0e..5415c2bd 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/EShopOnAbp.OrderingService.HttpApi.Host.csproj @@ -31,9 +31,4 @@ - - - - - diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js deleted file mode 100644 index 963782ee..00000000 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js +++ /dev/null @@ -1,9 +0,0 @@ -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); -}; \ No newline at end of file diff --git a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj index 7ac859a9..b4607f89 100644 --- a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj +++ b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/EShopOnAbp.PaymentService.HttpApi.Host.csproj @@ -26,9 +26,4 @@ - - - - - diff --git a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js b/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js deleted file mode 100644 index 963782ee..00000000 --- a/services/payment/src/EShopOnAbp.PaymentService.HttpApi.Host/wwwroot/swagger/ui/requestinterceptor.js +++ /dev/null @@ -1,9 +0,0 @@ -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); -}; \ No newline at end of file diff --git a/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj b/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj index 8a0b5e53..af2061f5 100644 --- a/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj +++ b/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj @@ -21,4 +21,15 @@ + + + true + PreserveNewest + + + + + + + diff --git a/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbpSharedHostingAspNetCoreModule.cs b/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbpSharedHostingAspNetCoreModule.cs index 7e3b8d8d..12f54210 100644 --- a/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbpSharedHostingAspNetCoreModule.cs +++ b/shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbpSharedHostingAspNetCoreModule.cs @@ -1,6 +1,7 @@ using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Modularity; using Volo.Abp.Swashbuckle; +using Volo.Abp.VirtualFileSystem; namespace EShopOnAbp.Shared.Hosting.AspNetCore; @@ -12,4 +13,11 @@ namespace EShopOnAbp.Shared.Hosting.AspNetCore; )] public class EShopOnAbpSharedHostingAspNetCoreModule : AbpModule { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded("EShopOnAbp.Shared.Hosting.AspNetCore"); + }); + } } \ No newline at end of file diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/wwwroot/swagger/ui/requestinterceptor.js b/shared/EShopOnAbp.Shared.Hosting.AspNetCore/wwwroot/swagger/ui/requestinterceptor.js similarity index 100% rename from gateways/web-public/src/EShopOnAbp.WebPublicGateway/wwwroot/swagger/ui/requestinterceptor.js rename to shared/EShopOnAbp.Shared.Hosting.AspNetCore/wwwroot/swagger/ui/requestinterceptor.js