Skip to content

Commit a4f024a

Browse files
committed
fixed check token in fetchNavBarData()
1 parent 485cd1d commit a4f024a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/nav-bar/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import LogoutAction from '@/components/logout-action/index.vue'
6363
import { useUserStore } from '@/stores/user-store'
6464
import Coins from '@/components/coins/index.vue'
6565
import { CoinType } from '@/types/goods-info'
66+
import { authConfig } from '@/config/request.config'
6667
6768
const router = useRouter()
6869
const route = useRoute()
@@ -160,8 +161,7 @@ const navigateTo = (path: string) => {
160161
}
161162
162163
onMounted(async () => {
163-
if (!localStorage.getItem('token')) {
164-
router.push('/')
164+
if (!localStorage.getItem(authConfig.tokenKey)) {
165165
return
166166
}
167167

0 commit comments

Comments
 (0)