From 6753ac30225ea1e902356aa6ded1b4968a5852ec Mon Sep 17 00:00:00 2001 From: Juan Carlos Ruvalcaba Date: Thu, 22 Apr 2021 14:39:01 -0700 Subject: [PATCH] Remove comments/references to old user login mode --- src/js/controllers/check.js | 4 ---- src/js/routes.js | 2 +- src/js/routes/login.js | 2 -- src/pages/home/panel-left.f7.html | 5 ----- src/pages/home/panel-right.f7.html | 8 -------- src/pages/login.f7.html | 4 ---- 6 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/js/controllers/check.js b/src/js/controllers/check.js index 523c996..0130b5e 100644 --- a/src/js/controllers/check.js +++ b/src/js/controllers/check.js @@ -1,11 +1,9 @@ -//import User from './users.js'; import user from './../stores/user.js'; let Check = { authorization( { to, resolve } ) { const router = this; if (!user.getters.isLogged.value){ - //if (!User.isLogged()){ router.navigate('/login/', { reloadCurrent: true }); } else{ @@ -14,8 +12,6 @@ let Check = { }, permission( { to, resolve, reject } ) { const router = this; - //const userData = JSON.parse(localStorage.getItem("userData")); - //const userRoles = userData['userPermissions']; const userRoles = user.getters.roles.value; let currentIndex = -1; diff --git a/src/js/routes.js b/src/js/routes.js index 3543603..1a9423a 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -2,8 +2,8 @@ import AboutPage from '../pages/about.f7.html'; import home from './routes/home.js'; import login from './routes/login.js'; -import not_found from './routes/not-found.js'; import forbidden from './routes/forbidden.js'; +import not_found from './routes/not-found.js'; import Check from './controllers/check'; diff --git a/src/js/routes/login.js b/src/js/routes/login.js index 42d49b9..c8af6c8 100644 --- a/src/js/routes/login.js +++ b/src/js/routes/login.js @@ -1,12 +1,10 @@ import LoginPage from '../../pages/login.f7.html'; -//import User from '../controllers/users.js'; import user from '../stores/user.js'; function checkAuth( { resolve } ) { const router = this; if (user.getters.isLogged.value){ - //if (User.isLogged()){ router.navigate('/', { reloadCurrent: true }); } else { diff --git a/src/pages/home/panel-left.f7.html b/src/pages/home/panel-left.f7.html index f25e708..30efbe6 100644 --- a/src/pages/home/panel-left.f7.html +++ b/src/pages/home/panel-left.f7.html @@ -129,7 +129,6 @@ import $ from 'dom7'; import store from '../../js/stores/index.js'; import user from '../../js/stores/user.js'; -//import User from '../../js/controllers/users.js'; export default (props, { $f7, $on, $update, }) => { let isLogged = user.getters.isLogged.value; @@ -140,10 +139,6 @@ export default (props, { $f7, $on, $update, }) => { const userRoles = user.getters.roles.value; const onPanelOpen = () => { - //if (User.isLogged()){ - //const userData = JSON.parse(localStorage.getItem("userData")); - //const userRoles = userData['userPermissions']; - //console.log("Roles:",userRoles.includes(4)); if (isLogged){ isCustomer = userRoles.includes(4); //Customer, isSeller = userRoles.includes(14); //Seller, diff --git a/src/pages/home/panel-right.f7.html b/src/pages/home/panel-right.f7.html index dc472a0..8f8d1db 100644 --- a/src/pages/home/panel-right.f7.html +++ b/src/pages/home/panel-right.f7.html @@ -64,7 +64,6 @@ import $ from 'dom7'; import store from '../../js/stores/index.js'; import user from '../../js/stores/user.js'; -//import User from '../../js/controllers/users.js'; export default (props, { $f7, $on, $update, $f7router }) => { let theme = store.getters.themeName.value; @@ -73,16 +72,9 @@ export default (props, { $f7, $on, $update, $f7router }) => { const onPanelOpen = () => { $('#light-theme').prop('checked', (theme != 'theme-dark') ? true : false ); - // if (User.isLogged()){ - // let data = JSON.parse(localStorage.getItem("userData")); - // $("#menu-username").text(data.contactName); - // isLogged = true; - // $update(); - // } }; const logout = () => { - //User.logOff(); user.dispatch('logOut').then( () => { $f7router.navigate('/'); $f7.toast.show( { text: "Ha cerrado sesiĆ³n." }); diff --git a/src/pages/login.f7.html b/src/pages/login.f7.html index 20b652e..1a66579 100644 --- a/src/pages/login.f7.html +++ b/src/pages/login.f7.html @@ -38,7 +38,6 @@