generated from template/astro-template
	fix
This commit is contained in:
		@@ -12,6 +12,7 @@ import { toast } from 'react-toastify';
 | 
				
			|||||||
import { hashFile } from '../../modules/hash-file';
 | 
					import { hashFile } from '../../modules/hash-file';
 | 
				
			||||||
import { uploadChunkV2 } from '../../modules/upload';
 | 
					import { uploadChunkV2 } from '../../modules/upload';
 | 
				
			||||||
import { downloadFile, toFile } from '../../modules/to-file';
 | 
					import { downloadFile, toFile } from '../../modules/to-file';
 | 
				
			||||||
 | 
					import dayjs from 'dayjs';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type ImageResource = {};
 | 
					type ImageResource = {};
 | 
				
			||||||
export const ImagesResources = (props: ImageResource) => {
 | 
					export const ImagesResources = (props: ImageResource) => {
 | 
				
			||||||
@@ -207,9 +208,11 @@ export const Core = ({ onClose, id }: CoreProps) => {
 | 
				
			|||||||
      for (const file of files) {
 | 
					      for (const file of files) {
 | 
				
			||||||
        if (file.dataURL.startsWith('data')) {
 | 
					        if (file.dataURL.startsWith('data')) {
 | 
				
			||||||
          const _file = toFile(file.dataURL, file.id);
 | 
					          const _file = toFile(file.dataURL, file.id);
 | 
				
			||||||
 | 
					          const day = dayjs().format('YYYY-MM');
 | 
				
			||||||
 | 
					          const directory = `excalidraw/${day}/${id}`;
 | 
				
			||||||
          const res = (await uploadChunkV2(_file, {
 | 
					          const res = (await uploadChunkV2(_file, {
 | 
				
			||||||
            filename: file.id,
 | 
					            filename: file.id,
 | 
				
			||||||
            directory: id,
 | 
					            directory: directory,
 | 
				
			||||||
          })) as any;
 | 
					          })) as any;
 | 
				
			||||||
          if (res.code === 200) {
 | 
					          if (res.code === 200) {
 | 
				
			||||||
            toast.success('上传图片成功');
 | 
					            toast.success('上传图片成功');
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user