Skip to content

Commit

Permalink
fix: modify logout name
Browse files Browse the repository at this point in the history
  • Loading branch information
chansee97 committed Jun 7, 2024
1 parent 89e8b0e commit 86ef62f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/layouts/components/header/UserCenter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -56,7 +56,7 @@ function handleSelect(key: string | number) {
positiveText: t('common.confirm'),
negativeText: t('common.cancel'),
onPositiveClick: () => {
logOut()
logout()
},
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/service/http/handle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export async function handleRefreshToken() {
}
else {
// 刷新失败,退出
await authStore.logOut()
await authStore.logout()
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/store/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useAuthStore = defineStore('auth-store', {
},
actions: {
/* 登录退出,重置用户信息等 */
async logOut() {
async logout() {
const route = unref(router.currentRoute)
// 清除本地缓存
this.clearAuthStorage()
Expand Down
2 changes: 1 addition & 1 deletion src/store/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const useRouteStore = defineStore('route-store', {

if (!userInfo || !userInfo.id) {
const authStore = useAuthStore()
authStore.logOut()
authStore.logout()
return
}

Expand Down

0 comments on commit 86ef62f

Please sign in to comment.