mirror of
https://github.com/dborth/vbagx.git
synced 2024-12-28 03:31:49 +01:00
commit
d71c4ffed5
@ -68,9 +68,6 @@ var app = new Framework7({
|
|||||||
cordovaApp.init(f7);
|
cordovaApp.init(f7);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve data for user on app start
|
|
||||||
user.dispatch('checkData').then(() =>{ });
|
|
||||||
|
|
||||||
//Intercept axios call to determine if it gets (401 Unauthorized) response
|
//Intercept axios call to determine if it gets (401 Unauthorized) response
|
||||||
http.interceptors.response.use(undefined, function (err) {
|
http.interceptors.response.use(undefined, function (err) {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import user from './../stores/user.js';
|
import user from './../stores/user.js';
|
||||||
|
|
||||||
let Check = {
|
let Check = {
|
||||||
authorization( { to, resolve } ) {
|
async authorization( { to, resolve } ) {
|
||||||
const router = this;
|
const router = this;
|
||||||
|
await user.dispatch('checkData');
|
||||||
if (!user.getters.isLogged.value){
|
if (!user.getters.isLogged.value){
|
||||||
router.navigate('/login/', { reloadCurrent: true });
|
router.navigate('/login/', { reloadCurrent: true });
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,6 @@ let routes = [
|
|||||||
name: 'about',
|
name: 'about',
|
||||||
path: '/about/',
|
path: '/about/',
|
||||||
component: AboutPage,
|
component: AboutPage,
|
||||||
allowedRoles: [15],
|
|
||||||
beforeEnter: [Check.authorization, Check.permission],
|
|
||||||
},
|
},
|
||||||
...home,
|
...home,
|
||||||
...login,
|
...login,
|
||||||
|
@ -2,11 +2,15 @@ import HomePage from '../../pages/home.f7.html';
|
|||||||
import LeftPanelPage from '../../pages/home/panel-left.f7.html';
|
import LeftPanelPage from '../../pages/home/panel-left.f7.html';
|
||||||
import RightPanelPage from '../../pages/home/panel-right.f7.html';
|
import RightPanelPage from '../../pages/home/panel-right.f7.html';
|
||||||
|
|
||||||
|
import Check from './../controllers/check';
|
||||||
|
|
||||||
const home = [
|
const home = [
|
||||||
{
|
{
|
||||||
name: 'home',
|
name: 'home',
|
||||||
path: '/',
|
path: '/',
|
||||||
component: HomePage,
|
component: HomePage,
|
||||||
|
allowedRoles: [1,9,10,14,15],
|
||||||
|
beforeEnter: [Check.authorization, Check.permission],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'panel-left-',
|
name: 'panel-left-',
|
||||||
|
Loading…
Reference in New Issue
Block a user