修复图片解密 修复密钥获取

This commit is contained in:
xuncha committed 2026-03-02 16:44:09 +08:00
1 parent fb8663fb24
commit 3d4a79aac6
8 files changed
+32 -14

No files matched your search

+10 -2
View File
@@ -15,8 +15,16 @@ function getStaticFfmpegPath(): string | null {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const ffmpegStatic = require('ffmpeg-static')
if (typeof ffmpegStatic === 'string' && existsSync(ffmpegStatic)) {
return ffmpegStatic
if (typeof ffmpegStatic === 'string') {
// 修复:如果路径包含 app.asar(打包后),自动替换为 app.asar.unpacked
let fixedPath = ffmpegStatic
if (fixedPath.includes('app.asar') && !fixedPath.includes('app.asar.unpacked')) {
fixedPath = fixedPath.replace('app.asar', 'app.asar.unpacked')
}
if (existsSync(fixedPath)) {
return fixedPath
}
}
// 方法2: 手动构建路径(开发环境)