import { http } from '@/util'
export const uploadImg = (image,pre,onProgress) => http.upload("/uploadImg",{
	filePath:image,
	custom:{type:'none',loading:false},
	name:"file",
	timeout:600000,
	formData:{pre},
	getTask: (task, options) => {
		task.onProgressUpdate((res) => {
			if(onProgress){
				onProgress(res.progress);
			}
		});
	}
});


export const upload = (file,pre,onProgress) => http.upload("/upload",{
	filePath:file,
	custom:{type:'none',loading:false},
	name:"file",
	timeout:600000,
	formData:{pre},
	getTask: (task, options) => {
		task.onProgressUpdate((res) => {
			if(onProgress){
				onProgress(res.progress);
			}
		});
	}
});

