import fetch from '@/utils/fetch'
import axios from 'axios'

export default function() {
  const source = axios.CancelToken.source()
  return {
    cancel() {
      source.cancel('cancel')
    },
    fetch(data) {
      return fetch({
        url: `/authdata/exesql`,
        cancelToken: source.token,
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
        },
        method: 'POST',
        data
      })
    }
  }
}
