import { defAxios as request } from '@/utils/http'

/**
 * @description: 获取音视频上传地址和凭证
 * @param {Object} params
 * @return {Object}
 */
export function getAuth(params) {
  return request({
    url: '/aliyuncsVod/createUploadVideo',
    method: 'get',
    params
  })
}

/**
 * @description: 刷新音/视频上传凭证
 * @param {String} videoId
 * @return {*}
 */
export function refreshAuth(videoId) {
  return request({
    url: '/aliyuncsVod/refreshUploadVideo',
    method: 'get',
    params: {
      videoId
    }
  })
}

/**
 * @description: 获取图片上传鉴权
 * @param {String} objectName
 * @return {*}
 */
export function getOssAuth(objectName) {
  return request({
    url: '/aliyunOss/getSecurityToken',
    method: 'get',
    responseAll: true,
    params: {
      objectName
    }
  })
}
