axios封装常用请求

import axios from 'axios'
import qs from 'qs'
import global from './global'

export default {
  
post(url, data) {
return axios({
method: 'post',
url,
data: data,
headers: {
'X-Requested-With': 'XMLHttpRequest',
'Content-Type': 'application/json; charset=UTF-8'
}
}).then(
(response) => {
return checkStatus(response)
}
).then(
(res) => {
return checkCode(res)
}
)
},



}

猜你喜欢

转载自www.cnblogs.com/zengxx/p/9984672.html