chore: 🔨 移除 console.log 打印
This commit is contained in:
@@ -14,16 +14,13 @@ export function setupPermission() {
|
|||||||
console.log("to.path", to.path);
|
console.log("to.path", to.path);
|
||||||
|
|
||||||
const isLogin = Auth.isLoggedIn();
|
const isLogin = Auth.isLoggedIn();
|
||||||
console.log("isLogin", isLogin);
|
|
||||||
if (isLogin) {
|
if (isLogin) {
|
||||||
console.log("to.path", to.path);
|
|
||||||
if (to.path === "/login") {
|
if (to.path === "/login") {
|
||||||
// 如果已登录,跳转到首页
|
// 如果已登录,跳转到首页
|
||||||
next({ path: "/" });
|
next({ path: "/" });
|
||||||
} else {
|
} else {
|
||||||
// 未登录
|
// 未登录
|
||||||
const permissionStore = usePermissionStore();
|
const permissionStore = usePermissionStore();
|
||||||
console.log("permissionStore.routesLoaded", permissionStore.routesLoaded);
|
|
||||||
// 判断路由是否加载完成
|
// 判断路由是否加载完成
|
||||||
if (permissionStore.routesLoaded) {
|
if (permissionStore.routesLoaded) {
|
||||||
if (to.matched.length === 0) {
|
if (to.matched.length === 0) {
|
||||||
@@ -39,7 +36,7 @@ export function setupPermission() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
// 生成动态路由
|
// 生成路由
|
||||||
const dynamicRoutes = await permissionStore.generateRoutes();
|
const dynamicRoutes = await permissionStore.generateRoutes();
|
||||||
dynamicRoutes.forEach((route: RouteRecordRaw) => router.addRoute(route));
|
dynamicRoutes.forEach((route: RouteRecordRaw) => router.addRoute(route));
|
||||||
next({ ...to, replace: true });
|
next({ ...to, replace: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user