fix: 修复缩略图显示权限问题,使用base64数据URL

解决asset.localhost访问权限问题:
- 添加read_thumbnail_as_data_url命令读取文件并转换为base64数据URL
- 避免使用convertFileSrc的asset.localhost协议访问问题
- 添加base64依赖支持文件编码

 优化缩略图加载:
- 使用数据URL直接在img标签中显示缩略图
- 正确处理Windows长路径前缀 \\\\?\\
- 统一错误处理和降级机制

 技术改进:
- 移除不再使用的convertFileSrc导入
- 添加详细的控制台日志便于调试
- 确保跨平台文件路径兼容性

现在缩略图可以正确显示,不会因为权限问题导致加载失败。
This commit is contained in:
imeepos
2025-07-15 22:38:22 +08:00
parent 723575ba7e
commit 44f3f40705
11 changed files with 68 additions and 1510 deletions

View File

@@ -25,7 +25,11 @@
}
],
"security": {
"csp": null
"csp": null,
"assetProtocol": {
"enable": true,
"scope": ["**"]
}
}
},