feat: 统一获取app-routes方法
This commit is contained in:
@ -1,9 +1,7 @@
|
||||
import type { RouteRecordNormalized } from 'vue-router';
|
||||
|
||||
import { useRouter } from 'vue-router';
|
||||
import { defineStore } from 'pinia';
|
||||
import { fetchProfileInfo } from '@/api/all/login';
|
||||
import { useSidebarStore } from '@/stores/modules/side-bar';
|
||||
import router from '@/router';
|
||||
import { glsWithCatch, slsWithCatch, rlsWithCatch } from '@/utils/stroage';
|
||||
|
||||
interface UserInfo {
|
||||
@ -80,8 +78,10 @@ export const useUserStore = defineStore('user', {
|
||||
},
|
||||
getUserAllowAccessRoutes() {
|
||||
const sidebarStore = useSidebarStore();
|
||||
const router = useRouter();
|
||||
|
||||
const menuList = sidebarStore.menuList;
|
||||
const appRoutes = router.getRoutes();
|
||||
const appRoutes = router.options.routes;
|
||||
|
||||
appRoutes.forEach((route: any) => {
|
||||
if (!route.meta?.requiresAuth) {
|
||||
|
||||
Reference in New Issue
Block a user