import axios from 'axios'

const instance = axios.create({
  // base接口，表示请求URL的公共部分
  baseURL: '',
  // 超时 设置为5分钟
  timeout: 5 * 60 * 1000
})

instance.interceptors.response.use(
  (res) => res.data,
  (error) => {
    console.log(error)
  }
)

export const sms = (data = {}) =>
  instance({
    url: '/api/digital/sms',
    method: 'post',
    data
  })

export default { sms }
