修复路径错误

This commit is contained in:
cc
2026-03-15 19:30:55 +08:00
parent ae75820b77
commit 7024b86d00

View File

@@ -5639,6 +5639,12 @@ class ChatService {
} }
// 3. 读取解密后的文件并转成 base64 // 3. 读取解密后的文件并转成 base64
// 如果已经是 data URL直接返回 base64 部分
if (result.localPath.startsWith('data:')) {
const base64Data = result.localPath.split(',')[1]
return { success: true, data: base64Data }
}
// localPath 是 file:// URL需要转换成文件路径 // localPath 是 file:// URL需要转换成文件路径
const filePath = result.localPath.startsWith('file://') const filePath = result.localPath.startsWith('file://')
? result.localPath.replace(/^file:\/\//, '') ? result.localPath.replace(/^file:\/\//, '')