aboutsummaryrefslogtreecommitdiff
path: root/src/site/plugins/axios.js
blob: 5a169b29686c7a8c3ca190ba4e685d10eb58e1e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
import Vue from 'vue';
import axios from 'axios';
import VueAxios from 'vue-axios';

Vue.use(VueAxios, axios);
Vue.axios.defaults.headers.common.Accept = 'application/vnd.lolisafe.json';
*/

export default function({ $axios, redirect }) {
	$axios.onRequest(config => {
		console.log(`Making request to > /${config.url}`);
	});
	$axios.setHeader('accept', 'application/vnd.lolisafe.json');

	$axios.onError(error => {
		// console.log('=====');
		console.log(error);
		// console.log('=====');
		/*
		$toast.open({
			duration: 2500,
			message: 'testing',
			position: 'is-bottom',
			type: error ? 'is-danger' : 'is-success'
		});
		*/
	});
}