style: прогнать prettier по frontend
This commit is contained in:
@@ -22,8 +22,14 @@ router.beforeEach(async (to, from, next) => {
|
||||
const adminStore = useAdminStoreHook();
|
||||
const hasRoles = adminStore.roles && adminStore.roles.length > 0;
|
||||
if (hasRoles) {
|
||||
if (adminStore.forcePasswordChange && to.path !== "/admin/change-password") {
|
||||
next({ path: "/admin/change-password", query: { redirect: to.fullPath } });
|
||||
if (
|
||||
adminStore.forcePasswordChange &&
|
||||
to.path !== "/admin/change-password"
|
||||
) {
|
||||
next({
|
||||
path: "/admin/change-password",
|
||||
query: { redirect: to.fullPath },
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Если маршрут не найден, перейти на 404
|
||||
@@ -34,14 +40,19 @@ router.beforeEach(async (to, from, next) => {
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
const { roles, forcePasswordChange } = await adminStore.getAdminInfo();
|
||||
const { roles, forcePasswordChange } =
|
||||
await adminStore.getAdminInfo();
|
||||
const permissionStore = usePermissionStoreHook();
|
||||
const accessRoutes = permissionStore.generateRoutes(roles);
|
||||
accessRoutes.forEach((route) => {
|
||||
router.addRoute(route);
|
||||
});
|
||||
if (forcePasswordChange && to.path !== "/admin/change-password") {
|
||||
next({ path: "/admin/change-password", query: { redirect: to.fullPath }, replace: true });
|
||||
next({
|
||||
path: "/admin/change-password",
|
||||
query: { redirect: to.fullPath },
|
||||
replace: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
next({ ...to, replace: true });
|
||||
|
||||
Reference in New Issue
Block a user