Skip to content

Commit 04083aa

Browse files
committed
fix: Pinia 初始化位置
1 parent fee70b3 commit 04083aa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createApp, Directive } from "vue"
2+
import store from "./store"
23
import router from "./router"
34
import "@/router/permission"
4-
import store from "./store"
55
import App from "./App.vue"
66
import ElementPlus from "element-plus"
77
import loadSvg from "@/icons"

src/router/permission.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import asyncRouteSettings from "@/config/async-route"
99
import NProgress from "nprogress"
1010
import "nprogress/nprogress.css"
1111

12-
const userStore = useUserStoreHook()
13-
const permissionStore = usePermissionStoreHook()
1412
NProgress.configure({ showSpinner: false })
1513

1614
router.beforeEach(async (to: RouteLocationNormalized, _: RouteLocationNormalized, next: any) => {
1715
NProgress.start()
16+
const userStore = useUserStoreHook()
17+
const permissionStore = usePermissionStoreHook()
1818
// 判断该用户是否登录
1919
if (getToken()) {
2020
if (to.path === "/login") {

0 commit comments

Comments
 (0)