win mac双平台修正

This commit is contained in:
Yeomai committed 2026-09-20 23:33:36 +08:00
1 parent 07c21f5954
commit 08456f26cf
4 files changed
+9 -9

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@
// 每次改动递增。Eagle 里的 service 插件是启动时加载并常驻的,改完代码必须重新加载插件
// 才会生效;状态栏会显示这个版本号,方便确认加载的到底是不是最新代码。
const VERSION = 'v59';
const VERSION = 'v60';
const path = require('path');
const os = require('os');
+3 -5
View File
@@ -9,6 +9,7 @@
const fs = require('fs');
const path = require('path');
const { pathToFileURL } = require('url');
const runtimeCache = new Map();
// 长动画不截断时间轴,只降低采样密度:18 fps 采样,最多 240 帧。
@@ -69,12 +70,9 @@ function loadRuntime(runtimeDir) {
return job;
}
/** 本地绝对路径 → file:// URL(逐段编码,保留盘符)。 */
/** 本地绝对路径 → file:// URL。交给 Node 的 pathToFileURL,Windows / macOS 都正确。 */
function fileUrl(filePath) {
const normalized = String(filePath).replace(/\\/g, '/');
return 'file:///' + normalized.split('/')
.map((part, index) => (index === 0 ? part : encodeURIComponent(part)))
.join('/');
return pathToFileURL(filePath).href;
}
/** 给可能挂起的异步操作套一层超时,避免队列被一个卡住的 Promise 堵死。 */