mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-25 06:57:15 +08:00
refactor: 适配系统配置
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import type { Router, LocationQueryRaw } from 'vue-router';
|
||||
import NProgress from 'nprogress'; // progress bar
|
||||
|
||||
import { useLoginStore } from '@/store';
|
||||
import { useLoginStore, useAppStore } from '@/store';
|
||||
import { isLogin } from '@/utils/auth';
|
||||
|
||||
export default function setupUserLoginInfoGuard(router: Router) {
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
NProgress.start();
|
||||
const loginStore = useLoginStore();
|
||||
const appStore = useAppStore();
|
||||
appStore.init();
|
||||
if (isLogin()) {
|
||||
if (loginStore.roles[0]) {
|
||||
next();
|
||||
|
Reference in New Issue
Block a user