94b6df9297ab69ecfe6fc30056931df4c754b08c.svn-base 467 B

12345678910111213141516171819202122
  1. import fetch from '@/utils/fetch'
  2. import axios from 'axios'
  3. export default function() {
  4. const source = axios.CancelToken.source()
  5. return {
  6. cancel() {
  7. source.cancel('cancel')
  8. },
  9. fetch(data) {
  10. return fetch({
  11. url: `/authdata/exesql`,
  12. cancelToken: source.token,
  13. headers: {
  14. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  15. },
  16. method: 'POST',
  17. data
  18. })
  19. }
  20. }
  21. }