- starting project list...

- ordering some functions
- fix error TS2339

quasar.extensions.json was the problem !
inside had:
{
  "@quasar/typescript": {
    "webpack": "plugin",
    "rename": true
  }
}
This commit is contained in:
Paolo Arena
2019-03-21 20:43:15 +01:00
parent 1fd56419a4
commit eda9a8514f
53 changed files with 28076 additions and 726 deletions

View File

@@ -1,5 +1,11 @@
// import something here
import { IMyRoute } from '@src/router/route-config'
// import { isEqual } from 'lodash'
import { ProgressBar } from '@src/store/Modules/Interface'
import { UserStore } from "@store"
export default ({ app, router, store, Vue }) => {
// ******************************************
// *** Per non permettere di accedere alle pagine in cui è necessario essere Loggati ! ***
@@ -8,42 +14,6 @@ export default ({ app, router, store, Vue }) => {
// Creates a `nextMiddleware()` function which not only
// runs the default `next()` callback but also triggers
// the subsequent Middleware function.
function nextFactory(context, middleware, index) {
const subsequentMiddleware = middleware[index]
// If no subsequent Middleware exists,
// the default `next()` callback is returned.
if (!subsequentMiddleware) { return context.next }
return (...parameters) => {
// Run the default Vue Router `next()` callback first.
context.next(...parameters)
// Then run the subsequent Middleware with a new
// `nextMiddleware()` callback.
const nextMiddleware = nextFactory(context, middleware, index + 1)
subsequentMiddleware({ ...context, next: nextMiddleware })
}
}
router.beforeEach((to, from, next) => {
if (to.meta.middleware) {
const middleware = Array.isArray(to.meta.middleware)
? to.meta.middleware
: [to.meta.middleware];
const context = {
from,
next,
router,
to,
};
const nextMiddleware = nextFactory(context, middleware, 1)
return middleware[0]({ ...context, next: nextMiddleware })
}
return next()
})
/*router.beforeEach((to, from, next) => {
var accessToken = store.state.session.userSession.accessToken