check delle autorizzazioni di accesso area su url di navigazione
This commit is contained in:
@@ -2,9 +2,10 @@ import Vue from "vue";
|
||||
import VueRouter from "vue-router";
|
||||
import VeeValidate from "vee-validate";
|
||||
import "./_base/gestures";
|
||||
|
||||
import "./app.modules";
|
||||
|
||||
import { store, machineStatusActions } from "./store";
|
||||
|
||||
const App = () =>
|
||||
import ("./App.vue");
|
||||
|
||||
@@ -20,6 +21,14 @@ router.addRoutes(routes);
|
||||
|
||||
// manipulate the title page
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (to.meta && to.meta.area) {
|
||||
// Check if area is enabled
|
||||
if (!machineStatusActions.isAreaEnabled(store, to.meta.area)) {
|
||||
next({
|
||||
path: '/'
|
||||
})
|
||||
}
|
||||
}
|
||||
if (to.meta && to.meta.title) {
|
||||
window.document.title = to.meta.title;
|
||||
}
|
||||
@@ -27,7 +36,7 @@ router.beforeEach((to, from, next) => {
|
||||
});
|
||||
|
||||
|
||||
import { store } from "./store";
|
||||
|
||||
|
||||
|
||||
let v = new Vue({
|
||||
|
||||
Reference in New Issue
Block a user