/*
 * @Author: xiejiang
 * @Date: 2024-11-05 10:14:56
 * @LastEditors: xiejiang
 * @LastEditTime: 2024-11-13 11:15:57
 * @Description: 、
 * Copyright（c）2024 by 好老师教育科技有限公司 All right Reserved.
 */
import { Upload } from '@/api/interface/upload'
import http from '@/api'

const api = {
  signature: '/base/ali/oss/signature',
  videoSignature: '/base/baijiayun/uploadUrl'
}

// 图片上传oss
export const signature = (fileName: string, noLoading=false) => {
  return http.get<Upload.Signature>(api.signature, { fileName },{noLoading} )
}
// 图片上传
export const uploadImg = (url: string, params: FormData) => {
  return http.post<Upload.ResFileUrl>(url, params)
}

// 视频上传
export const uploadVideo = (params: FormData) => {
  return http.post<Upload.ResFileUrl>(`/file/upload/video`, params)
}

// 视频上传
export const videoSignatureAPI = (params: object | undefined) => http.get(api.videoSignature, params)
