mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-03-02 01:30:51 +03:00
17 lines
541 B
JavaScript
17 lines
541 B
JavaScript
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
|
|
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
|
|
|
axios.interceptors.request.use(
|
|
(config) => {
|
|
if (config.data instanceof FormData) {
|
|
config.headers['Content-Type'] = 'multipart/form-data';
|
|
} else {
|
|
config.data = Qs.stringify(config.data, {
|
|
arrayFormat: 'repeat',
|
|
});
|
|
}
|
|
return config;
|
|
},
|
|
(error) => Promise.reject(error),
|
|
);
|