mirror of
https://github.com/dborth/vbagx.git
synced 2024-11-25 20:16:53 +01:00
Remove comments/references to old user login mode
This commit is contained in:
parent
6527eb953b
commit
6753ac3022
@ -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;
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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,
|
||||
|
@ -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." });
|
||||
|
@ -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){
|
||||
|
Loading…
Reference in New Issue
Block a user