fixed typescript error

This commit is contained in:
lloydzhou 2024-07-16 01:45:15 +08:00
parent bab3e0bc9b
commit 94bc880b7f
2 changed files with 7 additions and 12 deletions

View File

@ -253,17 +253,12 @@ export function Sd() {
onClick={async () => { onClick={async () => {
if (await showConfirm(Locale.Sd.Danger.Delete)) { if (await showConfirm(Locale.Sd.Danger.Delete)) {
// remove img_data + remove item in list // remove img_data + remove item in list
removeImage(item.img_data).finally( removeImage(item.img_data).finally(() => {
() => { sdStore.draw = sdImages.filter(
sdStore.draw = sdImages.filter( (i: any) => i.id !== item.id,
(i: any) => i.id !== item.id, );
); sdStore.getNextId();
sdStore.getNextId(); });
},
(error) => {
console.error(error);
},
);
} }
}} }}
/> />

View File

@ -64,7 +64,7 @@ export function base64Image2Blob(base64Data: string, contentType: string) {
return new Blob([byteArray], { type: contentType }); return new Blob([byteArray], { type: contentType });
} }
export function uploadImage(file: File): Promise<string> { export function uploadImage(file: Blob): Promise<string> {
const body = new FormData(); const body = new FormData();
body.append("file", file); body.append("file", file);
return fetch(UPLOAD_URL, { return fetch(UPLOAD_URL, {