-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
41 lines (32 loc) · 1.06 KB
/
main.js
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
30
31
32
33
34
35
36
37
38
39
40
41
import Vue from 'vue'
import { firestorePlugin } from 'vuefire'
import axios from 'axios'
import redisAxios from 'axios'
import Vuelidate from 'vuelidate'
import router from './router'
import store from './store'
Vue.use(Vuelidate)
import App from './App.vue'
Vue.config.productionTip = false
Vue.use(firestorePlugin)
axios.defaults.baseURL = 'https://aibase.firebaseio.com'
redisAxios.defaults.baseURL = 'http://localhost:3000'
// axios.defaults.headers.common['Authorization'] = 'aibase'
axios.defaults.headers.get['Accepts'] = 'application/json'
redisAxios.defaults.headers.get['Accepts'] = 'application/json'
const reqInterceptor = axios.interceptors.request.use(config => {
// console.log('Request interceptor', config)
// config.headers. ... = '...'
return config
})
const resInterceptor = axios.interceptors.response.use(res => {
// console.log('Response interceptor', res)
return res
})
axios.interceptors.request.eject(reqInterceptor)
axios.interceptors.response.eject(resInterceptor)
new Vue({
router,
store,
render: h => h(App),
}).$mount('#app')