win mac双平台修正
This commit is contained in:
1 parent
07c21f5954
commit
08456f26cf
4 files changed
+9
-9
No files matched your search
@@ -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 堵死。 */
|
||||
|
||||
Reference in new issue
Block a user