diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs index 367a4080..4a09d595 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs @@ -41,6 +41,7 @@ using EShopOnAbp.PaymentService.PaymentMethods; using EShopOnAbp.PublicWeb.AnonymousUser; using Microsoft.Extensions.Configuration; using Volo.Abp.VirtualFileSystem; +using EShopOnAbp.PublicWeb.Options; namespace EShopOnAbp.PublicWeb; @@ -93,6 +94,8 @@ public class EShopOnAbpPublicWebModule : AbpModule ); }); + Configure(options => { options.Default.BaseUrl = configuration["RemoteServices:Default:BaseUrl"]; }); + Configure(options => { options.IsEnabled = true; }); Configure(options => { options.KeyPrefix = "EShopOnAbp:"; }); @@ -167,7 +170,7 @@ public class EShopOnAbpPublicWebModule : AbpModule context.Services.AddStaticHttpClientProxies( typeof(BasketServiceContractsModule).Assembly, remoteServiceConfigurationName: BasketServiceConstants.RemoteServiceName ); - + Configure(options => { options.FileSets.AddEmbedded(); diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Options/RemoteServices.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/Options/RemoteServices.cs new file mode 100644 index 00000000..32dd1953 --- /dev/null +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Options/RemoteServices.cs @@ -0,0 +1,14 @@ +namespace EShopOnAbp.PublicWeb.Options +{ + public class RemoteServices + { + public Default Default { get; set; } = new(); + } + + public class Default + { + public string BaseUrl { get; set; } + } +} + + diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Index.cshtml b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Index.cshtml index bbf17a9b..7d7cb58b 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Index.cshtml +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Index.cshtml @@ -1,9 +1,12 @@ @page @using EShopOnAbp.Localization +@using EShopOnAbp.PublicWeb.Options @using Microsoft.Extensions.Localization @using System.Globalization +@using Microsoft.Extensions.Options @model EShopOnAbp.PublicWeb.Pages.IndexModel @inject IStringLocalizer L +@inject IOptions options @{ const int productsColumnSize = 4; // TODO: update abp-column helper to plain html for proper row and columns css @@ -38,7 +41,7 @@ { var product = Model.Products[(i * productsColumnSize) + j]; var productPrice = product.Price.ToString("C", new CultureInfo("en-US")); - string productImage = !product.ImageName.IsNullOrEmpty() ? $"/product-images/{product.ImageName}" : "/product-images/@product.ImageName"; + string productImage = !product.ImageName.IsNullOrEmpty() ? $"{options.Value.Default.BaseUrl}product-images/{product.ImageName}" : $"{options.Value.Default.BaseUrl}product-images/@product.ImageName"; string buyText = L["Index:AddToBasket"];
diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.json b/apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.json index 4769b9c2..d32d67d8 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.json +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.json @@ -12,7 +12,7 @@ "AllowedHosts": "*", "RemoteServices": { "Default": { - "BaseUrl": "https://localhost:44354/" + "BaseUrl": "https://localhost:44373/" } }, "StringEncryption": { diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/beats.jpg b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/beats.jpg deleted file mode 100644 index 08417c23..00000000 Binary files a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/beats.jpg and /dev/null differ diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/bluecat.jpg b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/bluecat.jpg deleted file mode 100644 index 794a734a..00000000 Binary files a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/bluecat.jpg and /dev/null differ diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/lego.jpg b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/lego.jpg deleted file mode 100644 index 63e31e95..00000000 Binary files a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/lego.jpg and /dev/null differ diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/nikon.jpg b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/nikon.jpg deleted file mode 100644 index eb6fb605..00000000 Binary files a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/nikon.jpg and /dev/null differ diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/noimage.jpg b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/noimage.jpg deleted file mode 100644 index 4c5133c8..00000000 Binary files a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/noimage.jpg and /dev/null differ diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/oki.jpg b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/oki.jpg deleted file mode 100644 index 6fefeec6..00000000 Binary files a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/oki.jpg and /dev/null differ diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/playstation.jpg b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/playstation.jpg deleted file mode 100644 index 88083240..00000000 Binary files a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/playstation.jpg and /dev/null differ diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/rampage.jpg b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/rampage.jpg deleted file mode 100644 index e49660df..00000000 Binary files a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/rampage.jpg and /dev/null differ diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/sunny.jpg b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/sunny.jpg deleted file mode 100644 index 8efff5a6..00000000 Binary files a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/product-images/sunny.jpg and /dev/null differ