mirror of
https://github.com/dborth/vbagx.git
synced 2024-12-27 11:11:50 +01:00
Updates:
-Disable location variable on user store file -Add .js extension to some imports.
This commit is contained in:
parent
d71c4ffed5
commit
b8ecd2e463
@ -2,7 +2,7 @@ import HomePage from '../../pages/home.f7.html';
|
||||
import LeftPanelPage from '../../pages/home/panel-left.f7.html';
|
||||
import RightPanelPage from '../../pages/home/panel-right.f7.html';
|
||||
|
||||
import Check from './../controllers/check';
|
||||
import Check from './../controllers/check.js';
|
||||
|
||||
const home = [
|
||||
{
|
||||
|
@ -2,7 +2,7 @@ import UserEditPage from '../../pages/user/edit-data.f7.html';
|
||||
import UserNewPage from '../../pages/user/new-data.f7.html';
|
||||
import UserResetPage from '../../pages/user/reset-data.f7.html';
|
||||
|
||||
import Check from '../controllers/check';
|
||||
import Check from '../controllers/check.js';
|
||||
|
||||
const users = [
|
||||
{
|
||||
|
@ -7,22 +7,22 @@ const user = createStore({
|
||||
token: '',
|
||||
user: {},
|
||||
roles: [],
|
||||
location: {},
|
||||
//location: {},
|
||||
},
|
||||
actions: {
|
||||
async setBasicData({ dispatch }, { token, user, roles, location }){
|
||||
async setBasicData({ dispatch }, { token, user, roles/*, location*/ }){
|
||||
await localForage.setItem('user', user);
|
||||
await localForage.setItem('token', token);
|
||||
await localForage.setItem('roles', roles);
|
||||
await localForage.setItem('location', location);
|
||||
dispatch('auth_success', { token, user, roles, location });
|
||||
//await localForage.setItem('location', location);
|
||||
dispatch('auth_success', { token, user, roles/*, location*/ });
|
||||
},
|
||||
async getBasicData({ dispatch }){
|
||||
const result = {
|
||||
user: await localForage.getItem('user'),
|
||||
token: await localForage.getItem('token'),
|
||||
roles: await localForage.getItem('roles'),
|
||||
location: await localForage.getItem('location'),
|
||||
//location: await localForage.getItem('location'),
|
||||
}
|
||||
dispatch('auth_success', result);
|
||||
},
|
||||
@ -30,7 +30,7 @@ const user = createStore({
|
||||
await localForage.deleteItem('user');
|
||||
await localForage.deleteItem('token');
|
||||
await localForage.deleteItem('roles');
|
||||
await localForage.deleteItem('location');
|
||||
//await localForage.deleteItem('location');
|
||||
},
|
||||
async checkData({ dispatch }){
|
||||
let token = await localForage.getItem('token');
|
||||
@ -48,7 +48,7 @@ const user = createStore({
|
||||
|
||||
delete response.data.token;
|
||||
delete response.data.roles;
|
||||
delete response.data.location;
|
||||
//delete response.data.location;
|
||||
|
||||
return response;
|
||||
}
|
||||
@ -69,17 +69,17 @@ const user = createStore({
|
||||
state.token = '';
|
||||
state.user = {};
|
||||
state.roles = [];
|
||||
state.location = {};
|
||||
//state.location = {};
|
||||
},
|
||||
auth_request({ state }){
|
||||
state.status = 'loading';
|
||||
},
|
||||
auth_success({ state }, { token, user, roles, location }){
|
||||
auth_success({ state }, { token, user, roles/*, location*/ }){
|
||||
state.status = 'success';
|
||||
state.token = token;
|
||||
state.user = user;
|
||||
state.roles = roles;
|
||||
state.location = location;
|
||||
//state.location = location;
|
||||
},
|
||||
auth_error({ state }){
|
||||
state.status = 'error'
|
||||
@ -99,9 +99,9 @@ const user = createStore({
|
||||
roles({ state }){
|
||||
return state.roles;
|
||||
},
|
||||
location({ state }){
|
||||
return state.location
|
||||
},
|
||||
// location({ state }){
|
||||
// return state.location
|
||||
// },
|
||||
displayName({ state }){
|
||||
return state.user;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user