import service from "./index";
const apiAdmin = '/mediate/'
const fetchApi = {
    //========================start::登录相关======================================
    // 登录
    login: data => {
         return service.service.post(`${apiAdmin}login`, data)
    },
    // 短信验证码
    sendVerifyCode: data => {
        return service.service.get(`${apiAdmin}sms/verifyCode?phone=${data}`,{hideLoading: true})
    },
    // 退出登录
    logout: data => {
        return service.service.get(`${apiAdmin}logout`, data)
    },
    // 修改密码
    updatePassword: data => {
          return service.service.post(`${apiAdmin}updatePassword`, data)
    },
    //========================end::登录相关======================================

    //========================start::上传相关======================================
    // 上传文件
    uploadFile: data => {
        return service.service.post(`${apiAdmin}upload/upload`, data,
          {
            headers:
              {'Content-Type': 'multipart/form-data'},
          },
        )
      },
      // 获取附件token
     getMinioToken(data) {
        return service.service.post(`${apiAdmin}minio/getMinioToken`, data)
    },
    //========================end::上传相关======================================
    // 文件下载
    downFile: data => {
        return service.service.post(`${apiAdmin}upload/down`, data)
    },
    // 文件预览
    viewFile: data => {
        return service.postFile(`${apiAdmin}upload/view`, data)
    },
    // 文件预览绝对地址
    viewFullFile: data => {
        return service.service.post(`${apiAdmin}upload/full`, data,{hideLoading:true})
    },
}
export default fetchApi;
