diff --git a/src/apps/draw/pages/core/Excalidraw.tsx b/src/apps/draw/pages/core/Excalidraw.tsx index 4522afd..4c890fa 100644 --- a/src/apps/draw/pages/core/Excalidraw.tsx +++ b/src/apps/draw/pages/core/Excalidraw.tsx @@ -12,6 +12,7 @@ import { toast } from 'react-toastify'; import { hashFile } from '../../modules/hash-file'; import { uploadChunkV2 } from '../../modules/upload'; import { downloadFile, toFile } from '../../modules/to-file'; +import dayjs from 'dayjs'; type ImageResource = {}; export const ImagesResources = (props: ImageResource) => { @@ -207,9 +208,11 @@ export const Core = ({ onClose, id }: CoreProps) => { for (const file of files) { if (file.dataURL.startsWith('data')) { const _file = toFile(file.dataURL, file.id); + const day = dayjs().format('YYYY-MM'); + const directory = `excalidraw/${day}/${id}`; const res = (await uploadChunkV2(_file, { filename: file.id, - directory: id, + directory: directory, })) as any; if (res.code === 200) { toast.success('上传图片成功');