
import { requestClient } from '#/api/request';


const uploadFile = (formData) => {
  return requestClient.post('/auth/FileDetail/upload' ,formData,{
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
};

//上传图片
const uploadImage = (formData) => {
  return requestClient.post('/auth/FileDetail/upload-image' ,formData,{
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
};

//上传视频
const uploadVideo = (formData) => {
  return requestClient.post('/auth/FileDetail/upload-video' ,formData,{
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
};

//上传Base64图片
const uploadBase64Image = (formData) => {
  return requestClient.post('/auth/FileDetail/upload-base64-image' ,formData,{
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
};



//上传文件后的返回值
// {
//   "url": "文件访问地址",
//   "md5": "文件MD5值"
// }
// 文件上传相关URI常量
export const base = {
  // 通用文件上传
  UPLOAD: '/auth/FileDetail/upload',
  
  // 图片上传（带缩略图）
  UPLOAD_IMAGE: '/auth/FileDetail/upload-image',
  
  // 视频上传
  UPLOAD_VIDEO: '/auth/FileDetail/upload-video',
  
  // Base64图片上传
  UPLOAD_BASE64_IMAGE: '/auth/FileDetail/upload-base64-image',
  uploadFile,
  uploadImage,
  uploadVideo,
  uploadBase64Image
};