feat: 持久化缓存

This commit is contained in:
kailong321200875
2023-11-29 21:09:37 +08:00
parent 7c76d945be
commit 893459da7c
10 changed files with 32 additions and 40 deletions

View File

@@ -7,10 +7,6 @@ import { useNProgress } from '@/hooks/web/useNProgress'
import { usePermissionStoreWithOut } from '@/store/modules/permission'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const permissionStore = usePermissionStoreWithOut()
const appStore = useAppStoreWithOut()
const { getStorage } = useStorage()
const { start, done } = useNProgress()
@@ -22,6 +18,8 @@ const whiteList = ['/login'] // 不重定向白名单
router.beforeEach(async (to, from, next) => {
start()
loadStart()
const permissionStore = usePermissionStoreWithOut()
const appStore = useAppStoreWithOut()
if (getStorage(appStore.getUserInfo)) {
if (to.path === '/login') {
next({ path: '/' })