import httpInstance from '@/utils/http'

export const uploadImage = (file) => {
    // 创建一个 FormData 对象
    const formData = new FormData();
    // 将文件添加到 FormData
    formData.append('file', file);
    
    // 发送 POST 请求
    return httpInstance({
        url: `/QiNiu/upload`,
        method: "post",
        data: formData, // 将 FormData 对象作为请求体
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}
