Directory Config for other project

This commit is contained in:
Paolo Arena
2019-05-02 16:58:36 +02:00
parent d924509d4f
commit 71ee9f6ae3
9 changed files with 22 additions and 313 deletions

View File

@@ -2,13 +2,14 @@ import Vue from 'vue'
import VueRouter, { RouterMode } from 'vue-router'
import { PositionResult } from 'vue-router/types/router'
import { IMyRoute, IMyRouteRecord, routesList } from './route-config'
import { IMyRoute, IMyRouteRecord } from './route-config'
import { ProgressBar } from '@src/store/Modules/Interface'
import { isEqual } from 'lodash'
import { UserStore } from '@store'
import { RouteNames } from '@src/router/route-names'
import { tools } from '@src/store/Modules/tools'
import { cfgrouter } from '../../cfg_locale'
Vue.use(VueRouter)
/*
* If not building with SSR mode, you can
@@ -17,7 +18,7 @@ Vue.use(VueRouter)
const Router = new VueRouter({
scrollBehavior: () => ({ x: 0, y: 0 } as PositionResult),
routes: routesList,
routes: cfgrouter.routes,
// Leave these as is and change from quasar.conf.js instead!
// quasar.conf.js -> build -> vueRouterMode
@@ -124,7 +125,7 @@ Router.beforeEach(async (to: IMyRoute, from: IMyRoute, next) => {
// next('/')
}
return Router.push({ name: RouteNames.login })
return Router.push({ name: 'login' })
}
} else if (to.matched.some((m) => m.meta.noAuth) && UserStore.state.isLogged) {
next('/')