diff --git a/src/layouts/components/header/UserCenter.vue b/src/layouts/components/header/UserCenter.vue index 5298aaf..c592b77 100644 --- a/src/layouts/components/header/UserCenter.vue +++ b/src/layouts/components/header/UserCenter.vue @@ -8,7 +8,7 @@ import IconBookOpen from '~icons/icon-park-outline/book-open' const { t } = useI18n() -const { userInfo, logOut } = useAuthStore() +const { userInfo, logout } = useAuthStore() const router = useRouter() const options = computed(() => { @@ -56,7 +56,7 @@ function handleSelect(key: string | number) { positiveText: t('common.confirm'), negativeText: t('common.cancel'), onPositiveClick: () => { - logOut() + logout() }, }) } diff --git a/src/service/http/handle.ts b/src/service/http/handle.ts index e605bf6..8de84a1 100644 --- a/src/service/http/handle.ts +++ b/src/service/http/handle.ts @@ -77,7 +77,7 @@ export async function handleRefreshToken() { } else { // 刷新失败,退出 - await authStore.logOut() + await authStore.logout() } } diff --git a/src/store/auth.ts b/src/store/auth.ts index 39558b0..2120ab9 100644 --- a/src/store/auth.ts +++ b/src/store/auth.ts @@ -23,7 +23,7 @@ export const useAuthStore = defineStore('auth-store', { }, actions: { /* 登录退出,重置用户信息等 */ - async logOut() { + async logout() { const route = unref(router.currentRoute) // 清除本地缓存 this.clearAuthStorage() diff --git a/src/store/router/index.ts b/src/store/router/index.ts index edc6e57..6c1ad3f 100644 --- a/src/store/router/index.ts +++ b/src/store/router/index.ts @@ -41,7 +41,7 @@ export const useRouteStore = defineStore('route-store', { if (!userInfo || !userInfo.id) { const authStore = useAuthStore() - authStore.logOut() + authStore.logout() return }