1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2026-01-22 23:50:22 +08:00

chore: 重构权限路由守卫

This commit is contained in:
zclzone
2024-03-31 18:33:58 +08:00
parent c754d02dc0
commit 961ad6af7b
7 changed files with 1040 additions and 586 deletions

View File

@@ -105,7 +105,6 @@ import { throttle, lStorage } from '@/utils'
import { useStorage } from '@vueuse/core'
import api from './api'
import { useAuthStore } from '@/store'
import { initUserAndPermissions } from '@/router'
const authStore = useAuthStore()
const router = useRouter()
@@ -167,7 +166,6 @@ async function onLoginSuccess(data = {}) {
authStore.setToken(data)
$message.loading('登录中...', { key: 'login' })
try {
await initUserAndPermissions()
$message.success('登录成功', { key: 'login' })
if (route.query.redirect) {
const path = route.query.redirect