2020-09-24 07:33:12 +00:00
|
|
|
import axios from '../config/axiosConfig'
|
|
|
|
|
|
|
|
axios.interceptors.response.use((response)=>{
|
|
|
|
return response.data;
|
|
|
|
},(error)=>{
|
|
|
|
return error;
|
|
|
|
})
|
|
|
|
|
2020-10-09 08:04:20 +00:00
|
|
|
function get(url: string,data?: object) {
|
2020-09-24 07:33:12 +00:00
|
|
|
return axios.get(url,{params:data})
|
|
|
|
}
|
|
|
|
|
2020-10-09 08:04:20 +00:00
|
|
|
function post(url: string,data?: object) {
|
2020-09-24 07:33:12 +00:00
|
|
|
return axios.post(url,data)
|
|
|
|
}
|
|
|
|
|
|
|
|
export {
|
|
|
|
get,
|
|
|
|
post
|
|
|
|
}
|