Commit 6a0b13e8 authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh

lint fixed

parent ffa01ab4
......@@ -29,32 +29,30 @@
</div>
</template>
<script>
import SideBar from '@/components/SideBar'
export default {
components: {
Sidebar
SideBar
},
methods: {
logout() {
logout () {
fetch('http://127.0.0.1:8000/api/logout', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
accept: 'application/json',
accept: 'application/json'
},
body: JSON.stringify({
token: this.$auth.$storage.getUniversal('token'),
}),
});
token: this.$auth.$storage.getUniversal('token')
})
})
localStorage.setItem('token', '')
this.$auth.$storage.setUniversal('loggedIn', 'false')
this.$auth.$storage.setUniversal('token', '')
this.$auth.$storage.setUniversal('userName', '')
this.$router.push('/login')
},
},
}
}
}
</script>
<style>
</style>
......@@ -14,11 +14,7 @@
<script>
export default {
name: 'SideBar',
}
</script>
<script>
export default {
data() {
data () {
return {
variant: 'dark',
variants: [
......@@ -31,9 +27,9 @@ export default {
'success',
'danger',
'warning',
'info',
],
};
},
'info'
]
}
}
}
</script>
<template>
<div>
<Navbar />
<NavBar />
<nuxt />
</div>
</template>
<script>
import Navbar from '@/components/Navbar'
import NavBar from '@/components/NavBar'
export default {
components: { Navbar },
};
components: {
NavBar
}
}
</script>
export default ({ redirect }) => {
if (localStorage.getItem('token') == '') {
if (typeof localStorage !== 'undefined' && !localStorage.getItem('token')) {
return redirect('/login')
}
}
\ No newline at end of file
}
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