feat: support local storage

This commit is contained in:
Hk-Gosuto
2024-01-05 18:41:16 +08:00
parent 8e10354109
commit 296df592e0
18 changed files with 181 additions and 56 deletions

View File

@@ -465,10 +465,10 @@ export function ChatActions(props: {
const onImageSelected = async (e: any) => {
const file = e.target.files[0];
const api = new ClientApi();
const fileName = await api.file.upload(file);
const uploadFile = await api.file.upload(file);
props.imageSelected({
fileName,
fileUrl: `/api/file/${fileName}`,
fileName: uploadFile.fileName,
fileUrl: uploadFile.filePath,
});
e.target.value = null;
};