import request from './request';
import { ElMessage } from 'element-plus'

const http = function (url: string, data: object, options: object) {
  return request.post(url, data, options)
    .then(response => {
      if (response.code === "1") {
        return response.data
      }
    })
    .catch(e => {
      console.log(e)
    })
}

export default http