123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import axios from 'axios'
- const MA = axios.create({
- baseURL: window.location.origin + '/' + drupalSettings.path.pathPrefix,
- withCredentials: true,
- headers: {
- 'Content-Type': 'application/json'
-
- }
- })
- MA.interceptors.response.use(
- response => {
-
- return Promise.resolve(response)
-
- },
- error => {
- const { status } = error.response
- console.warn('error in ma-axios interceptor', status)
- if (status === 403) {
- window.location = '/'
- }
- return Promise.reject(error)
- }
- )
- export default MA
|