From 06fa7f0a9b585874e28aa333eb180baddf8e28bc Mon Sep 17 00:00:00 2001 From: qiqi Date: Sun, 22 Nov 2026 19:54:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(promptlib):=201.6.6=20=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=B0=81=E9=9D=A2/=E5=8F=82=E8=80=83=E5=9B=BE=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E8=B5=B0=20fileApi=EF=BC=88=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E5=90=8E=20{img}=20=E5=8F=AF=E8=A7=A3=E6=9E=90=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- promptlib/src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/promptlib/src/index.js b/promptlib/src/index.js index 68fac6e..e702a15 100644 --- a/promptlib/src/index.js +++ b/promptlib/src/index.js @@ -60,7 +60,7 @@ function fileApi (ctx) { if (ctx.files && typeof ctx.files.put === 'function') return ctx.files var P = ctx.promptlib - if (P && typeof P.filePut === 'function') { + if (P && typeof P.fileGet === 'function') { return { put: function (n, d) { return P.filePut(n, d) }, get: function (n) { return P.fileGet(n) }, @@ -1598,7 +1598,7 @@ } if (!on || !key) { done(''); return } if (typeof cover === 'string' && cover.indexOf('data:') === 0) { done(cover); return } - if (ctx.files) Promise.resolve(ctx.files.get(key)).then(function (r) { done(r && r.ok ? r.url : '') }).catch(function () { done('') }) + if (fileApi(ctx)) Promise.resolve(fileApi(ctx).get(key)).then(function (r) { done(r && r.ok ? r.url : '') }).catch(function () { done('') }) else done('') }) return st @@ -1644,7 +1644,7 @@ if (url) { st.thumb.src = url; st.thumb.style.display = '' } else st.thumb.style.display = 'none' } if (typeof cover === 'string' && cover.indexOf('data:') === 0) show(cover) - else if (coverKey && ctx.files) Promise.resolve(ctx.files.get(coverKey)).then(function (r) { show(r && r.ok ? r.url : '') }).catch(function () { show('') }) + else if (coverKey && fileApi(ctx)) Promise.resolve(fileApi(ctx).get(coverKey)).then(function (r) { show(r && r.ok ? r.url : '') }).catch(function () { show('') }) else show('') } if (!coverKey) st.thumb.style.display = 'none'