修改: web/docker环境下资源返回路径从原本的固定地址修改为相对路径地址

This commit is contained in:
a12110 2026-04-10 16:00:08 +08:00
parent 5529e90ce9
commit 2b6a185cf1

View File

@ -50,7 +50,7 @@ class OSS {
await this.ensureInit();
const safePath = normalizeUserPath(userRelPath);
// URL 始终使用 /,所以这里需要将系统分隔符转回 /
let url = `http://127.0.0.1:10588/${prefix}/`;
let url = `/${prefix}/`;
if (isEletron()) url = `http://localhost:${process.env.PORT}/${prefix}/`;
return `${url}${safePath.split(path.sep).join("/")}`;
}