重构:Wails升级/mermaid主题切换/代码高亮修复/文件系统UI重构
- Wails v2.12.0升级(App绑定新增API、runtime类型扩展) - 修复mermaid暗色主题切换渲染失败(SVG textContent污染→data-mermaid-src保存源码) - 修复代码高亮全语言失效(languageMap静态白名单替代运行时hljs检查) - 文件系统:FileListPanel重写、FileItemRow合并删除、Toolbar简化 - 新增剪贴板图片粘贴(Ctrl+V粘贴图片到当前目录) - 死代码清理:DeviceTest/errorHandler/useLocalStorage移除 - MarkdownEditor优化、theme store增强、CodeMirror加载器精简
This commit is contained in:
@@ -12,7 +12,8 @@ import { debugError } from '@/utils/debugLog'
|
||||
function transformFile(file: any): File {
|
||||
return {
|
||||
...file,
|
||||
isDir: file.is_dir
|
||||
isDir: file.is_dir,
|
||||
modified_time: file.mod_time
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,6 +100,22 @@ export async function writeFile(path: string, content: string): Promise<void> {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存 Base64 编码的二进制文件(图片等)
|
||||
*/
|
||||
export async function saveBase64File(path: string, base64Content: string): Promise<void> {
|
||||
if (!window.go?.main?.App?.SaveBase64File) {
|
||||
throw new Error('SaveBase64File API 不可用')
|
||||
}
|
||||
if (!base64Content) {
|
||||
throw new Error('无效的 base64 内容')
|
||||
}
|
||||
await window.go.main.App.SaveBase64File({
|
||||
path: String(path),
|
||||
content: base64Content
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件或目录
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user