js test with axios interceptors
This commit is contained in:
@ -4,6 +4,22 @@ import axios from 'axios'
|
||||
|
||||
// console.log('drupalSettings', drupalSettings)
|
||||
|
||||
// axios.interceptors.response.use(
|
||||
// response => {
|
||||
// // console.log('ma-axios interceptor response', response)
|
||||
// return Promise.resolve(response)
|
||||
// // return response
|
||||
// },
|
||||
// error => {
|
||||
// const { status } = error.response
|
||||
// console.warn('error in ma-axios response interceptor, status:', status)
|
||||
// if (status === 403) {
|
||||
// window.location = '/'
|
||||
// }
|
||||
// return Promise.reject(error)
|
||||
// }
|
||||
// )
|
||||
|
||||
const MA = axios.create({
|
||||
baseURL: window.location.origin + '/' + drupalSettings.path.pathPrefix,
|
||||
withCredentials: true,
|
||||
|
@ -5,6 +5,20 @@ import axios from 'axios'
|
||||
// console.log('drupalSettings', drupalSettings)
|
||||
// console.log('window.location.origin', window.location.origin)
|
||||
|
||||
// axios.interceptors.response.use(
|
||||
// response => {
|
||||
// return Promise.resolve(response)
|
||||
// },
|
||||
// error => {
|
||||
// const { status } = error.response
|
||||
// console.warn('error in rest-axios', status)
|
||||
// if (status === 403) {
|
||||
// window.location = '/'
|
||||
// }
|
||||
// return Promise.reject(error)
|
||||
// }
|
||||
// )
|
||||
|
||||
const REST = axios.create({
|
||||
baseURL: window.location.origin + '/' + drupalSettings.path.pathPrefix,
|
||||
withCredentials: true,
|
||||
|
Reference in New Issue
Block a user