js test with axios interceptors
This commit is contained in:
parent
a352b9745b
commit
48292c4f81
|
@ -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,
|
||||
|
|
|
@ -133,7 +133,7 @@ export default {
|
|||
}
|
||||
},
|
||||
beforeMount () {
|
||||
console.log(this.item.id, this.samples)
|
||||
// console.log(this.item.id, this.samples)
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
|
|
|
@ -3,7 +3,7 @@ export default {
|
|||
directives: {
|
||||
lazy: {
|
||||
bind (figure, binding) {
|
||||
console.log('directive lazy bind', figure, binding)
|
||||
// console.log('directive lazy bind', figure, binding)
|
||||
// show only the first image
|
||||
if (binding.value === 0) {
|
||||
const img = figure.querySelector('img:not(.blank)')
|
||||
|
|
|
@ -169,6 +169,7 @@ export default {
|
|||
})
|
||||
.catch((error) => {
|
||||
console.warn('Issue with getResults', error)
|
||||
// window.location.reload()
|
||||
Promise.reject(error)
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue