|
@@ -5,6 +5,20 @@ import axios from 'axios'
|
|
// console.log('drupalSettings', drupalSettings)
|
|
// console.log('drupalSettings', drupalSettings)
|
|
// console.log('window.location.origin', window.location.origin)
|
|
// 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({
|
|
const REST = axios.create({
|
|
baseURL: window.location.origin + '/' + drupalSettings.path.pathPrefix,
|
|
baseURL: window.location.origin + '/' + drupalSettings.path.pathPrefix,
|
|
withCredentials: true,
|
|
withCredentials: true,
|