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';
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;

View File

@ -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';

View File

@ -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 {

View File

@ -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,

View File

@ -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." });

View File

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