Skip to content
Merged
Changes from 1 commit
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
16 changes: 15 additions & 1 deletion src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class AutoRedirect : BootstrapModuleComponentBase
/// <para lang="en">Gets or sets the auto lock screen interval in milliseconds. Default is 60000 ms</para>
/// </summary>
[Parameter]
public int Interval { get; set; } = 60000;
public int Interval { get; set; }
Comment thread
ArgoZhang marked this conversation as resolved.

/// <summary>
/// <para lang="zh">获得/设置 地址跳转前回调方法 返回 true 时中止跳转</para>
Expand All @@ -53,6 +53,20 @@ public class AutoRedirect : BootstrapModuleComponentBase
/// </summary>
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, Interval, nameof(Lock));

/// <summary>
/// <inheritdoc/>
/// </summary>
protected override void OnParametersSet()
{
base.OnParametersSet();

if (Interval <= 0)
{
// 默认 10 分钟
Interval = 10 * 60 * 1000;
}
Comment thread
ArgoZhang marked this conversation as resolved.
}

/// <summary>
/// <para lang="zh">锁屏操作由 JS 调用</para>
/// <para lang="en">Lock screen operation called by JS</para>
Expand Down
Loading