PASSAGGIO A VITE !
AGG. 1.1.23
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
import { boot } from 'quasar/wrappers'
|
||||
|
||||
import { useGlobalStore } from '@src/store/globalStore';
|
||||
import { useUserStore } from '@src/store/UserStore';
|
||||
import { tools } from '@src/store/Modules/tools';
|
||||
|
||||
export default boot(({ app, router }) => {
|
||||
// ******************************************
|
||||
@@ -19,13 +21,19 @@ export default boot(({ app, router }) => {
|
||||
// the subsequent Middleware function.
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
console.log('beforeEach ROUTER')
|
||||
console.log('beforeEach ROUTER', from, to )
|
||||
// Execute your command before each navigation
|
||||
// executeCommand();
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
const userStore = useUserStore()
|
||||
try {
|
||||
globalStore.editOn = false
|
||||
if (userStore.isLogged && from.path !== to.path) {
|
||||
// console.log('globalStore.editOn = false (prima era = ', globalStore.editOn, ')')
|
||||
const pageKey = to.path
|
||||
// console.log('pagek=', pageKey)
|
||||
globalStore.editOn = tools.getCookie('edn_' + pageKey, '0') === '1'
|
||||
}
|
||||
} catch(e) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user