support stable diffusion plugin (#49)

This commit is contained in:
Hk-Gosuto
2023-10-17 12:52:33 +08:00
committed by GitHub
parent 3454ea3602
commit 516f3f4cb1
14 changed files with 269 additions and 47 deletions

View File

@@ -51,11 +51,16 @@ export default class S3FileStorage {
console.log(signedUrl);
await fetch(signedUrl, {
method: "PUT",
body: data,
});
try {
await fetch(signedUrl, {
method: "PUT",
body: data,
});
return `/api/file/${fileName}`;
return `/api/file/${fileName}`;
} catch (e) {
console.error("[R2]", e);
throw e;
}
}
}