From fe6c232762363bb7aca288047959678912e95625 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 29 Mar 2026 16:36:18 +0800 Subject: [PATCH 1/3] feat(AutoRedirect): set Interval parameter default value to 10m --- .../Components/AutoRedirect/AutoRedirect.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs b/src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs index 583cb14ff32..9cbcb2c5b8b 100644 --- a/src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs +++ b/src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs @@ -31,7 +31,7 @@ public class AutoRedirect : BootstrapModuleComponentBase /// Gets or sets the auto lock screen interval in milliseconds. Default is 60000 ms /// [Parameter] - public int Interval { get; set; } = 60000; + public int Interval { get; set; } /// /// 获得/设置 地址跳转前回调方法 返回 true 时中止跳转 @@ -53,6 +53,20 @@ public class AutoRedirect : BootstrapModuleComponentBase /// protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, Interop, Interval, nameof(Lock)); + /// + /// + /// + protected override void OnParametersSet() + { + base.OnParametersSet(); + + if (Interval <= 0) + { + // 默认 10 分钟 + Interval = 10 * 60 * 1000; + } + } + /// /// 锁屏操作由 JS 调用 /// Lock screen operation called by JS From c6812b1f743c325f688f4bd61d9e4ab602f6f5f0 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 30 Mar 2026 16:47:12 +0800 Subject: [PATCH 2/3] =?UTF-8?q?refactor:=20=E4=BD=BF=E7=94=A8=E5=8F=AF?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/AutoRedirect/AutoRedirect.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs b/src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs index 9cbcb2c5b8b..325772334de 100644 --- a/src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs +++ b/src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs @@ -27,11 +27,11 @@ public class AutoRedirect : BootstrapModuleComponentBase public bool IsForceLoad { get; set; } /// - /// 获得/设置 自动锁屏间隔单位 秒 默认 60000 毫秒 - /// Gets or sets the auto lock screen interval in milliseconds. Default is 60000 ms + /// 获得/设置 自动锁屏间隔单位 秒 默认 null 内部使用 60000 毫秒 + /// Gets or sets the auto lock interval in seconds. Default is null, internally uses 60000 milliseconds /// [Parameter] - public int Interval { get; set; } + public int? Interval { get; set; } /// /// 获得/设置 地址跳转前回调方法 返回 true 时中止跳转 @@ -60,7 +60,7 @@ protected override void OnParametersSet() { base.OnParametersSet(); - if (Interval <= 0) + if (Interval is null) { // 默认 10 分钟 Interval = 10 * 60 * 1000; From 12afdffa3cf7dae72a56c6fb9438111b2e899f76 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 30 Mar 2026 16:48:00 +0800 Subject: [PATCH 3/3] =?UTF-8?q?revert:=20=E6=92=A4=E9=94=80=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/AutoRedirect/AutoRedirect.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs b/src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs index 325772334de..bea1720fbce 100644 --- a/src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs +++ b/src/BootstrapBlazor/Components/AutoRedirect/AutoRedirect.cs @@ -27,11 +27,11 @@ public class AutoRedirect : BootstrapModuleComponentBase public bool IsForceLoad { get; set; } /// - /// 获得/设置 自动锁屏间隔单位 秒 默认 null 内部使用 60000 毫秒 - /// Gets or sets the auto lock interval in seconds. Default is null, internally uses 60000 milliseconds + /// 获得/设置 自动锁屏间隔单位 秒 默认 0 内部使用 60000 毫秒 + /// Gets or sets the auto lock interval in seconds. Default is 0, internally uses 60000 milliseconds /// [Parameter] - public int? Interval { get; set; } + public int Interval { get; set; } /// /// 获得/设置 地址跳转前回调方法 返回 true 时中止跳转 @@ -60,7 +60,7 @@ protected override void OnParametersSet() { base.OnParametersSet(); - if (Interval is null) + if (Interval <= 0) { // 默认 10 分钟 Interval = 10 * 60 * 1000;