mirror of
https://github.com/chansee97/nova-admin.git
synced 2026-07-25 15:35:08 +08:00
Compare commits
4 Commits
8a5d8a67ea
...
86ef62f841
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86ef62f841 | ||
|
|
89e8b0e3e1 | ||
|
|
ec85ffaea2 | ||
|
|
02ce6568b7 |
@ -2,34 +2,36 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div id="loading-container">
|
<naive-provider>
|
||||||
<div class="boxes">
|
<div id="loading-container">
|
||||||
<div class="box">
|
<div class="boxes">
|
||||||
<div />
|
<div class="box">
|
||||||
<div />
|
<div />
|
||||||
<div />
|
<div />
|
||||||
<div />
|
<div />
|
||||||
</div>
|
<div />
|
||||||
<div class="box">
|
</div>
|
||||||
<div />
|
<div class="box">
|
||||||
<div />
|
<div />
|
||||||
<div />
|
<div />
|
||||||
<div />
|
<div />
|
||||||
</div>
|
<div />
|
||||||
<div class="box">
|
</div>
|
||||||
<div />
|
<div class="box">
|
||||||
<div />
|
<div />
|
||||||
<div />
|
<div />
|
||||||
<div />
|
<div />
|
||||||
</div>
|
<div />
|
||||||
<div class="box">
|
</div>
|
||||||
<div />
|
<div class="box">
|
||||||
<div />
|
<div />
|
||||||
<div />
|
<div />
|
||||||
<div />
|
<div />
|
||||||
|
<div />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</naive-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import IconBookOpen from '~icons/icon-park-outline/book-open'
|
|||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const { userInfo, resetAuthStore } = useAuthStore()
|
const { userInfo, logout } = useAuthStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const options = computed(() => {
|
const options = computed(() => {
|
||||||
@ -56,7 +56,7 @@ function handleSelect(key: string | number) {
|
|||||||
positiveText: t('common.confirm'),
|
positiveText: t('common.confirm'),
|
||||||
negativeText: t('common.cancel'),
|
negativeText: t('common.cancel'),
|
||||||
onPositiveClick: () => {
|
onPositiveClick: () => {
|
||||||
resetAuthStore()
|
logout()
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,7 @@ export async function handleRefreshToken() {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// 刷新失败,退出
|
// 刷新失败,退出
|
||||||
await authStore.resetAuthStore()
|
await authStore.logout()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export const useAuthStore = defineStore('auth-store', {
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
/* 登录退出,重置用户信息等 */
|
/* 登录退出,重置用户信息等 */
|
||||||
async resetAuthStore() {
|
async logout() {
|
||||||
const route = unref(router.currentRoute)
|
const route = unref(router.currentRoute)
|
||||||
// 清除本地缓存
|
// 清除本地缓存
|
||||||
this.clearAuthStorage()
|
this.clearAuthStorage()
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export const useRouteStore = defineStore('route-store', {
|
|||||||
|
|
||||||
if (!userInfo || !userInfo.id) {
|
if (!userInfo || !userInfo.id) {
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
authStore.resetAuthStore()
|
authStore.logout()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user