Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private async Task SetCulture(SelectedItem item)
if (SelectedCulture != item.Value)
{
var culture = item.Value;
var uri = new Uri(NavigationManager.Uri).GetComponents(UriComponents.PathAndQuery, UriFormat.Unescaped);
var uri = new Uri(NavigationManager.Uri).GetComponents(UriComponents.PathAndQuery, UriFormat.SafeUnescaped);
var query = $"?culture={Uri.EscapeDataString(culture)}&redirectUri={Uri.EscapeDataString(uri)}";

// use a path that matches your culture redirect controller from the previous steps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private Task SetLang(string cultureName)
// 使用 api 方式 适用于 Server-Side 模式
if (SelectedCulture != cultureName)
{
var uri = new Uri(NavigationManager.Uri).GetComponents(UriComponents.PathAndQuery, UriFormat.Unescaped);
var uri = new Uri(NavigationManager.Uri).GetComponents(UriComponents.PathAndQuery, UriFormat.SafeUnescaped);
var query = $"?culture={Uri.EscapeDataString(cultureName)}&redirectUri={Uri.EscapeDataString(uri)}";

// use a path that matches your culture redirect controller from the previous steps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public class CultureController : Controller
if (SelectedCulture != item.Value)
{
var culture = item.Value;
var uri = new Uri(NavigationManager.Uri).GetComponents(UriComponents.PathAndQuery, UriFormat.Unescaped);
var uri = new Uri(NavigationManager.Uri).GetComponents(UriComponents.PathAndQuery, UriFormat.SafeUnescaped);
var query = $"?culture={Uri.EscapeDataString(culture)}&redirectUri={Uri.EscapeDataString(uri)}";

// use a path that matches your culture redirect controller from the previous steps
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/HtmlTag/Link.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@namespace BootstrapBlazor.Components
@inherits BootstrapComponentBase

<link @attributes="AdditionalAttributes" href="@GetHref()" rel="stylesheet" />
<link @attributes="AdditionalAttributes" href="@GetHref()" rel="@Rel" />
7 changes: 7 additions & 0 deletions src/BootstrapBlazor/Components/HtmlTag/Link.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ public partial class Link
[EditorRequired]
public string? Href { get; set; }

/// <summary>
/// 获得/设置 Rel 属性值, 默认 stylesheet
/// </summary>
[Parameter]
[EditorRequired]
public string? Rel { get; set; }= "stylesheet";

/// <summary>
/// 获得/设置 版本号 默认 null 自动生成
/// </summary>
Expand Down