Skip to content
Merged
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
20 changes: 17 additions & 3 deletions src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public class AutoRedirect : BootstrapModuleComponentBase
public bool IsForceLoad { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 自动锁屏间隔单位 秒 默认 60000 毫秒</para>
/// <para lang="en">Gets or sets the auto lock screen interval in milliseconds. Default is 60000 ms</para>
/// <para lang="zh">获得/设置 自动锁屏间隔单位 秒 默认 0 内部使用 60000 毫秒</para>
/// <para lang="en">Gets or sets the auto lock interval in seconds. Default is 0, internally uses 60000 milliseconds</para>
/// </summary>
[Parameter]
public int Interval { get; set; } = 60000;
public int Interval { get; set; }

/// <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;
}
}

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