From 3816363a7e462479e5d994b55c15a3aa8fb121e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=9C=E8=8F=AF?= Date: Sun, 19 Feb 2023 04:02:52 +0800 Subject: [PATCH] fs img --- server/api/img/[id].ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/api/img/[id].ts b/server/api/img/[id].ts index ce19bd2..0577133 100644 --- a/server/api/img/[id].ts +++ b/server/api/img/[id].ts @@ -8,7 +8,10 @@ export default defineEventHandler(async event => { if (!fs.existsSync('outputs')) { path = `../outputs/outputs/txt2img-samples/samples/${event.context.params.id}` } - return await useStorage().getItem(`img:${event.context.params.id}`) + // 读取图片文件 + let image = fs.readFileSync(path) + // 返回图片 + return image } })