import axios from 'axios'
const service = axios.create({
  baseURL: window.g.requestConfig_baseURL,
  timeout: 1500000 // 请求超时时间
})

class HttpCli {
  // 新增Post方法
  static Post(url, content, config) {
    return new Promise((resolve, reject) => {
      service.post(url, content, config).then(response => {
        resolve(response)
      }).catch(error => {
        reject(error)
      })
    })
  }
  static Get(url, params) {
    return new Promise((resolve, reject) => {
      service.get(url, { params: params }).then(response => {
        resolve(response)
      }).catch(error => {
        reject(error)
      })
    })
  }
}
export {
  HttpCli
}
