Update:New EBook API endpoint

This commit is contained in:
advplyr 2023-05-28 10:47:28 -05:00
parent b3f19ef628
commit 4f75a89633
11 changed files with 72 additions and 40 deletions

View file

@ -7,15 +7,10 @@ export default function ({ $axios, store, $config }) {
if (config.url.startsWith('http:') || config.url.startsWith('https:')) {
return
}
var bearerToken = store.state.user.user ? store.state.user.user.token : null
const bearerToken = store.state.user.user?.token || null
if (bearerToken) {
config.headers.common['Authorization'] = `Bearer ${bearerToken}`
}
if (process.env.NODE_ENV === 'development') {
config.url = `/dev${config.url}`
console.log('Making request to ' + config.url)
}
})
$axios.onError(error => {