fix(应用与系统)!: 修复组件执行与参数校验
修正 PID 空结果、目标类型判断与转换、毫秒等待。 让关闭程序和命令行按所选模式显示并校验参数。 统一 PowerShell 输出编码,修正 BAT 路径引号处理。 明确屏保和屏幕唤醒的实际能力,补充缺陷回归测试。 验证:类型检查、构建与组件回归检查通过。 BREAKING CHANGE: 判断数据类型改为返回布尔值。 需要类型名称的旧流程请改用 Basic_Type。 屏保 V1 移除未实现参数,旧自定义密码节点需重新添加。
This commit is contained in:
1 parent
f74d1865da
commit
5f9e28715c
16 files changed
+402
-144
No files matched your search
@@ -30,12 +30,21 @@ register("Basic_Delay_V2", async (ctx, node, args) => {
|
||||
return seconds;
|
||||
});
|
||||
|
||||
register(["Basic_Delay_V1", "Basic_Delay"], async (ctx, node, args) => {
|
||||
register("Basic_Delay_V1", async (ctx, node, args) => {
|
||||
const seconds = toNumber(args.second ?? args.time ?? 1, 1);
|
||||
await sleep(Math.max(0, seconds) * 1000, ctx.signal);
|
||||
return seconds;
|
||||
});
|
||||
|
||||
register("Basic_Delay", async (ctx, node, args) => {
|
||||
const milliseconds = Number(args.mileSecond ?? 1000);
|
||||
if (!Number.isFinite(milliseconds) || milliseconds < 0 || milliseconds > 2_147_483_647) {
|
||||
throw new RuntimeError("validation_error", "延时时间必须是 0~2147483647 范围内的毫秒数", { nodeId: node.id, componentId: node.componentId });
|
||||
}
|
||||
await sleep(milliseconds, ctx.signal);
|
||||
return milliseconds / 1000;
|
||||
});
|
||||
|
||||
register("Basic_DebugOutput", (ctx, node, args) => {
|
||||
const message = String(args.msg ?? args.message ?? "");
|
||||
ctx.log(message || "(空)", "info", node.id);
|
||||
|
||||
Reference in new issue
Block a user