Fix some checkout page if RootPath is set (#659)

This commit is contained in:
nicolas.dorier
2019-03-09 00:48:33 +09:00
parent 7e67ca1413
commit 7dad814f19
3 changed files with 5 additions and 4 deletions

View File

@@ -273,6 +273,7 @@ namespace BTCPayServer.Controllers
var model = new PaymentModel() var model = new PaymentModel()
{ {
CryptoCode = network.CryptoCode, CryptoCode = network.CryptoCode,
RootPath = this.Request.PathBase.Value.WithTrailingSlash(),
PaymentMethodId = paymentMethodId.ToString(), PaymentMethodId = paymentMethodId.ToString(),
PaymentMethodName = GetDisplayName(paymentMethodId, network), PaymentMethodName = GetDisplayName(paymentMethodId, network),
CryptoImage = GetImage(paymentMethodId, network), CryptoImage = GetImage(paymentMethodId, network),
@@ -345,9 +346,8 @@ namespace BTCPayServer.Controllers
private string GetImage(PaymentMethodId paymentMethodId, BTCPayNetwork network) private string GetImage(PaymentMethodId paymentMethodId, BTCPayNetwork network)
{ {
var res = paymentMethodId.PaymentType == PaymentTypes.BTCLike ? return paymentMethodId.PaymentType == PaymentTypes.BTCLike ?
Url.Content(network.CryptoImagePath) : Url.Content(network.LightningImagePath); this.Request.GetRelativePathOrAbsolute(network.CryptoImagePath) : this.Request.GetRelativePathOrAbsolute(network.LightningImagePath);
return "/" + res;
} }
private string OrderAmountFromInvoice(string cryptoCode, ProductInformation productInformation) private string OrderAmountFromInvoice(string cryptoCode, ProductInformation productInformation)

View File

@@ -64,5 +64,6 @@ namespace BTCPayServer.Models.InvoicingModels
public bool CoinSwitchEnabled { get; set; } public bool CoinSwitchEnabled { get; set; }
public string CoinSwitchMode { get; set; } public string CoinSwitchMode { get; set; }
public string CoinSwitchMerchantId { get; set; } public string CoinSwitchMerchantId { get; set; }
public string RootPath { get; set; }
} }
} }

View File

@@ -126,7 +126,7 @@
.use(window.i18nextXHRBackend) .use(window.i18nextXHRBackend)
.init({ .init({
backend: { backend: {
loadPath: '/locales/{{lng}}.json' loadPath: '@(Model.RootPath)locales/{{lng}}.json'
}, },
lng: startingLanguage, lng: startingLanguage,
fallbackLng: fallbackLanguage, fallbackLng: fallbackLanguage,