Remove comments/references to old user login mode

This commit is contained in:
Juan Carlos Ruvalcaba 2021-04-22 14:39:01 -07:00
parent 6527eb953b
commit 6753ac3022
6 changed files with 1 additions and 24 deletions

View File

@ -1,11 +1,9 @@
//import User from './users.js';
import user from './../stores/user.js'; import user from './../stores/user.js';
let Check = { let Check = {
authorization( { to, resolve } ) { authorization( { to, resolve } ) {
const router = this; const router = this;
if (!user.getters.isLogged.value){ if (!user.getters.isLogged.value){
//if (!User.isLogged()){
router.navigate('/login/', { reloadCurrent: true }); router.navigate('/login/', { reloadCurrent: true });
} }
else{ else{
@ -14,8 +12,6 @@ let Check = {
}, },
permission( { to, resolve, reject } ) { permission( { to, resolve, reject } ) {
const router = this; const router = this;
//const userData = JSON.parse(localStorage.getItem("userData"));
//const userRoles = userData['userPermissions'];
const userRoles = user.getters.roles.value; const userRoles = user.getters.roles.value;
let currentIndex = -1; let currentIndex = -1;

View File

@ -2,8 +2,8 @@ import AboutPage from '../pages/about.f7.html';
import home from './routes/home.js'; import home from './routes/home.js';
import login from './routes/login.js'; import login from './routes/login.js';
import not_found from './routes/not-found.js';
import forbidden from './routes/forbidden.js'; import forbidden from './routes/forbidden.js';
import not_found from './routes/not-found.js';
import Check from './controllers/check'; import Check from './controllers/check';

View File

@ -1,12 +1,10 @@
import LoginPage from '../../pages/login.f7.html'; import LoginPage from '../../pages/login.f7.html';
//import User from '../controllers/users.js';
import user from '../stores/user.js'; import user from '../stores/user.js';
function checkAuth( { resolve } ) { function checkAuth( { resolve } ) {
const router = this; const router = this;
if (user.getters.isLogged.value){ if (user.getters.isLogged.value){
//if (User.isLogged()){
router.navigate('/', { reloadCurrent: true }); router.navigate('/', { reloadCurrent: true });
} }
else { else {

View File

@ -129,7 +129,6 @@
import $ from 'dom7'; import $ from 'dom7';
import store from '../../js/stores/index.js'; import store from '../../js/stores/index.js';
import user from '../../js/stores/user.js'; import user from '../../js/stores/user.js';
//import User from '../../js/controllers/users.js';
export default (props, { $f7, $on, $update, }) => { export default (props, { $f7, $on, $update, }) => {
let isLogged = user.getters.isLogged.value; let isLogged = user.getters.isLogged.value;
@ -140,10 +139,6 @@ export default (props, { $f7, $on, $update, }) => {
const userRoles = user.getters.roles.value; const userRoles = user.getters.roles.value;
const onPanelOpen = () => { const onPanelOpen = () => {
//if (User.isLogged()){
//const userData = JSON.parse(localStorage.getItem("userData"));
//const userRoles = userData['userPermissions'];
//console.log("Roles:",userRoles.includes(4));
if (isLogged){ if (isLogged){
isCustomer = userRoles.includes(4); //Customer, isCustomer = userRoles.includes(4); //Customer,
isSeller = userRoles.includes(14); //Seller, isSeller = userRoles.includes(14); //Seller,

View File

@ -64,7 +64,6 @@
import $ from 'dom7'; import $ from 'dom7';
import store from '../../js/stores/index.js'; import store from '../../js/stores/index.js';
import user from '../../js/stores/user.js'; import user from '../../js/stores/user.js';
//import User from '../../js/controllers/users.js';
export default (props, { $f7, $on, $update, $f7router }) => { export default (props, { $f7, $on, $update, $f7router }) => {
let theme = store.getters.themeName.value; let theme = store.getters.themeName.value;
@ -73,16 +72,9 @@ export default (props, { $f7, $on, $update, $f7router }) => {
const onPanelOpen = () => { const onPanelOpen = () => {
$('#light-theme').prop('checked', (theme != 'theme-dark') ? true : false ); $('#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 = () => { const logout = () => {
//User.logOff();
user.dispatch('logOut').then( () => { user.dispatch('logOut').then( () => {
$f7router.navigate('/'); $f7router.navigate('/');
$f7.toast.show( { text: "Ha cerrado sesión." }); $f7.toast.show( { text: "Ha cerrado sesión." });

View File

@ -38,7 +38,6 @@
</template> </template>
<script> <script>
import $ from 'dom7'; import $ from 'dom7';
//import User from '../js/controllers/users.js';
import user from '../js/stores/user.js'; import user from '../js/stores/user.js';
export default (props, { $f7, $on, $update, $f7router }) => { export default (props, { $f7, $on, $update, $f7router }) => {
@ -62,9 +61,6 @@ export default (props, { $f7, $on, $update, $f7router }) => {
UserData : username, UserData : username,
UserPassword : password, UserPassword : password,
}; };
// var username = $('#username').val();
// var password = $('#password').val();
// User.checkLogin(username, password).then(function(result){
user.dispatch('logIn', data).then(function(result){ user.dispatch('logIn', data).then(function(result){
$f7.preloader.hide(); $f7.preloader.hide();
if (result.status === 200){ if (result.status === 200){