mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-19 08:10:49 +08:00
fix installation for beta5
This commit is contained in:
13
admin/src/utils/axios.js
vendored
13
admin/src/utils/axios.js
vendored
@@ -8,13 +8,14 @@ axios.defaults.withCredentials = true
|
||||
axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest'
|
||||
axios.defaults.headers['Content-Type'] = 'application/json'
|
||||
axios.defaults.headers['Accept'] = 'application/json'
|
||||
axios.defaults.headers['Authorization'] = 'Bearer ' + localGet('token')
|
||||
// axios.defaults.headers['Authorization'] = 'Bearer ' + localGet('token')
|
||||
|
||||
// axios.interceptors.request.use(config => {
|
||||
// // console.log('before request', config)
|
||||
// config.headers['Authorization'] = 'Bearer ' + localGet('token')
|
||||
// return config
|
||||
// })
|
||||
axios.interceptors.request.use(config => {
|
||||
config.headers['Authorization'] = 'Bearer ' + localGet('token')
|
||||
return config
|
||||
}, error => {
|
||||
return Promise.reject(error)
|
||||
})
|
||||
|
||||
axios.interceptors.response.use(res => {
|
||||
console.log(res)
|
||||
|
||||
Reference in New Issue
Block a user