Commit 035cdff9 authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh

remove header

parent 47bd40b3
...@@ -47,15 +47,9 @@ export default { ...@@ -47,15 +47,9 @@ export default {
try { try {
const resp = await this.$axios.post('/logout', { const resp = await this.$axios.post('/logout', {
token: this.$auth.$storage.getUniversal('token') token: this.$auth.$storage.getUniversal('token')
},
{
headers: {
'Content-Type': 'application/json',
accept: 'application/json'
}
}) })
if (resp.status == '200') { if (resp.status == '200') {
this.$toast.success('Successfully authenticated', { this.$toast.success('Logout!', {
duration: 2000 duration: 2000
}) })
this.$router.push('/login') this.$router.push('/login')
......
...@@ -115,13 +115,7 @@ export default { ...@@ -115,13 +115,7 @@ export default {
{ {
email: this.email, email: this.email,
password: this.password, password: this.password,
status: this.status, status: this.status
},
{
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
}
}) })
localStorage.setItem("token", resp.data.data.bearer_token) localStorage.setItem("token", resp.data.data.bearer_token)
this.$auth.$storage.setUniversal("token", resp.data.data.bearer_token) this.$auth.$storage.setUniversal("token", resp.data.data.bearer_token)
...@@ -141,6 +135,7 @@ export default { ...@@ -141,6 +135,7 @@ export default {
} }
} }
} }
}
</script> </script>
<style scoped> <style scoped>
.body { .body {
......
export default function ({ $axios }, inject, redirect) { export default function ({ $axios }, inject, redirect) {
$axios.onError(error => { $axios.onError((error) => {
if(error.response.status === 500) { if (error.response.status === 500) {
redirect('/500') redirect('/500')
} }
}) })
$axios.onError(error => { $axios.onError((error) => {
const code = parseInt(error.response && error.response.status) const code = parseInt(error.response && error.response.status)
if (code === 400) { if (code === 400) {
redirect('/400') redirect('/400')
...@@ -15,7 +15,8 @@ export default function ({ $axios }, inject, redirect) { ...@@ -15,7 +15,8 @@ export default function ({ $axios }, inject, redirect) {
const api = $axios.create({ const api = $axios.create({
headers: { headers: {
common: { common: {
Accept: 'application/json, text/plain, */*' Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json, text/plain, */*'
} }
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment