Compare commits

...

4 Commits

Author SHA1 Message Date
chansee97
86ef62f841 fix: modify logout name 2024-06-07 23:58:02 +08:00
chansee97
89e8b0e3e1 fix: modify apploading 2024-06-07 23:15:27 +08:00
chansee97
ec85ffaea2 fix: check window.$message 2024-06-07 21:39:46 +08:00
chansee97
02ce6568b7 fix: modify logout name 2024-06-07 21:04:57 +08:00
5 changed files with 33 additions and 31 deletions

View File

@ -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>

View File

@ -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()
}, },
}) })
} }

View File

@ -77,7 +77,7 @@ export async function handleRefreshToken() {
} }
else { else {
// 刷新失败,退出 // 刷新失败,退出
await authStore.resetAuthStore() await authStore.logout()
} }
} }

View File

@ -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()

View File

@ -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
} }