forked from geolba/tethys.frontend
- axios config for cors
This commit is contained in:
parent
1660bc6830
commit
39d323b619
8 changed files with 1198 additions and 1262 deletions
|
@ -1,7 +1,13 @@
|
|||
import axios, { AxiosRequestConfig, AxiosInstance, AxiosPromise } from "axios";
|
||||
|
||||
const initialization = (config: AxiosRequestConfig): AxiosInstance => {
|
||||
axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
|
||||
//axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
|
||||
delete axios.defaults.headers.common["X-Requested-With"];
|
||||
// axios.defaults.withCredentials = true;
|
||||
// const token = document.head.querySelector('meta[name="csrf-token"]');
|
||||
// if (token) {
|
||||
// axios.defaults.headers.common["X-CSRF-TOKEN"] = token.innerHTML;
|
||||
// }
|
||||
const axiosInstance = axios.create(config);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue