mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-20 19:09:21 +08:00
fix: Pinia 初始化位置
This commit is contained in:
parent
fee70b3342
commit
04083aab2a
@ -1,7 +1,7 @@
|
||||
import { createApp, Directive } from "vue"
|
||||
import store from "./store"
|
||||
import router from "./router"
|
||||
import "@/router/permission"
|
||||
import store from "./store"
|
||||
import App from "./App.vue"
|
||||
import ElementPlus from "element-plus"
|
||||
import loadSvg from "@/icons"
|
||||
|
@ -9,12 +9,12 @@ import asyncRouteSettings from "@/config/async-route"
|
||||
import NProgress from "nprogress"
|
||||
import "nprogress/nprogress.css"
|
||||
|
||||
const userStore = useUserStoreHook()
|
||||
const permissionStore = usePermissionStoreHook()
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
router.beforeEach(async (to: RouteLocationNormalized, _: RouteLocationNormalized, next: any) => {
|
||||
NProgress.start()
|
||||
const userStore = useUserStoreHook()
|
||||
const permissionStore = usePermissionStoreHook()
|
||||
// 判断该用户是否登录
|
||||
if (getToken()) {
|
||||
if (to.path === "/login") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user