Vue中axios的全局封装
axios封装
import axios from 'axios'
import Qs from 'qs'
import VueCookies from 'vue-cookies';
// const {set, get, isKey } = VueCookies
// const AUTH_TOKEN = 1
const axiosInstance = axios.create({
baseURL: '域名',
headers: {
// 'Authorization': AUTH_TOKEN,
'Content-Type': 'application/x-www-form-urlencoded'
},
transformRequest: [function(data, headers) {
if (headers['Conten
Vue中axios的全局封装最先出现在Python成神之路。
共有 0 条评论