import request from '@/utils/request'

// 登录方法
export function login(username, password, code, uuid) {
  const data = {
    username,
    password,
    code,
    uuid
  }
  return request({
    url: '/login',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 注册方法
export function register(data) {
  return request({
    url: '/register',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
//用户注册 带企业信息
export function registerEntApi(data) {
  return request({
    url: '/ent/user/regEnt',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}
// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/getInfo',
    method: 'get'
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    url: '/captchaImage',
    headers: {
      isToken: false
    },
    method: 'get',
    timeout: 20000
  })
}
//获取企业详细信息
export function getEntUserById(token, query) {
  return request({
    url: '/ent/user/ent',
    token: token,
    method: 'get',
    params: query
  })
}
//重新提交审核
export function entUserAudit(token,data) {
  return request({
    url: `/ent/user/auth`,
    token: token,
    method: 'put',
    data: data
  })
}
//获取项目附件
export function getEnclosureApi(token,attachType,dataId) {
  return request({
    url: `/common/attach/attach/${attachType}/${dataId}`,
    token: token,
    method: 'get'
  })
}
//删除附件信息
export function deleteEnclosureApi(ids) {
  return request({
    url: `/common/attach/${ids}`,
    token: token,
    method: 'delete'
  })
}
