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