fix(plugins): pluginFilePut 解包 dataURL 取 bytes 字段(封面文件化生效)+ promptlib 1.6.4

This commit is contained in:
qiqi committed 2026-11-22 19:40:45 +08:00
1 parent 61597deb2b
commit 8e19e7322f
5 files changed
+38 -8

No files matched your search

+2 -1
View File
@@ -594,7 +594,8 @@
async function pluginFilePut (id, name, dataUrl) {
try {
if (!pluginFileNameOk(name)) return { ok: false, error: '非法文件名(只允许小写字母/数字/-/_ + jpg/png/webp)' }
const bytes = dataUrlToBytes(String(dataUrl || ''))
const decoded = dataUrlToBytes(String(dataUrl || ''))
const bytes = decoded && decoded.bytes
if (!bytes || !bytes.length) return { ok: false, error: '图片数据为空' }
const stat = await pluginFileStat(id)
const existing = stat.files.find((f) => f.name === name)