admin user and ui panel
This commit is contained in:
@@ -117,6 +117,9 @@ router.beforeEach(async (to) => {
|
||||
if (token) {
|
||||
const roles = await getPermission();
|
||||
if (roles && to.meta && to.meta.role && !roles.includes(to.meta.role as string)) {
|
||||
if (to.name === 'dashboard-ecommerce' || to.name === 'dashboard-analytics') {
|
||||
return { name: 'my-data' };
|
||||
}
|
||||
return { name: 'page-not-authorized' };
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user