1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
import qs from 'qs' const axios = window.axios axios.interceptors.request.use(function (config) { let noche = new Date().getTime() if (config.method === 'post') { let data = qs.parse(config.data) config.data = qs.stringify({ noche, ...data }) } else if (config.method === 'get') { config.params = { noche, ...config.params } } return config }, function (error) { return Promise.reject(error) })
|
近期评论