move isLogin to removeToken
This commit is contained in:
parent
48d46f6098
commit
737d86f901
@ -78,7 +78,6 @@ const router = useRouter()
|
||||
|
||||
function logout() {
|
||||
authStore.removeToken()
|
||||
authStore.isLogin = false
|
||||
router.push({ path: '/' })
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,6 @@ async function login() {
|
||||
async function logout() {
|
||||
try {
|
||||
authStore.removeToken()
|
||||
authStore.isLogin = false
|
||||
} catch (e) {
|
||||
formError.value = e as string
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ export const useAuth = defineStore('auth', {
|
||||
removeToken() {
|
||||
const cookie = useCookie('token')
|
||||
cookie.value = null
|
||||
this.isLogin = false
|
||||
this.jwtToken = ''
|
||||
this.authHeader = {}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user