mirror of
https://github.com/dborth/vbagx.git
synced 2024-11-23 02:59:17 +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 LeftPanelPage from '../../pages/home/panel-left.f7.html';
|
||||||
import RightPanelPage from '../../pages/home/panel-right.f7.html';
|
import RightPanelPage from '../../pages/home/panel-right.f7.html';
|
||||||
|
|
||||||
import Check from './../controllers/check';
|
import Check from './../controllers/check.js';
|
||||||
|
|
||||||
const home = [
|
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 UserNewPage from '../../pages/user/new-data.f7.html';
|
||||||
import UserResetPage from '../../pages/user/reset-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 = [
|
const users = [
|
||||||
{
|
{
|
||||||
|
@ -7,22 +7,22 @@ const user = createStore({
|
|||||||
token: '',
|
token: '',
|
||||||
user: {},
|
user: {},
|
||||||
roles: [],
|
roles: [],
|
||||||
location: {},
|
//location: {},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
async setBasicData({ dispatch }, { token, user, roles, location }){
|
async setBasicData({ dispatch }, { token, user, roles/*, location*/ }){
|
||||||
await localForage.setItem('user', user);
|
await localForage.setItem('user', user);
|
||||||
await localForage.setItem('token', token);
|
await localForage.setItem('token', token);
|
||||||
await localForage.setItem('roles', roles);
|
await localForage.setItem('roles', roles);
|
||||||
await localForage.setItem('location', location);
|
//await localForage.setItem('location', location);
|
||||||
dispatch('auth_success', { token, user, roles, location });
|
dispatch('auth_success', { token, user, roles/*, location*/ });
|
||||||
},
|
},
|
||||||
async getBasicData({ dispatch }){
|
async getBasicData({ dispatch }){
|
||||||
const result = {
|
const result = {
|
||||||
user: await localForage.getItem('user'),
|
user: await localForage.getItem('user'),
|
||||||
token: await localForage.getItem('token'),
|
token: await localForage.getItem('token'),
|
||||||
roles: await localForage.getItem('roles'),
|
roles: await localForage.getItem('roles'),
|
||||||
location: await localForage.getItem('location'),
|
//location: await localForage.getItem('location'),
|
||||||
}
|
}
|
||||||
dispatch('auth_success', result);
|
dispatch('auth_success', result);
|
||||||
},
|
},
|
||||||
@ -30,7 +30,7 @@ const user = createStore({
|
|||||||
await localForage.deleteItem('user');
|
await localForage.deleteItem('user');
|
||||||
await localForage.deleteItem('token');
|
await localForage.deleteItem('token');
|
||||||
await localForage.deleteItem('roles');
|
await localForage.deleteItem('roles');
|
||||||
await localForage.deleteItem('location');
|
//await localForage.deleteItem('location');
|
||||||
},
|
},
|
||||||
async checkData({ dispatch }){
|
async checkData({ dispatch }){
|
||||||
let token = await localForage.getItem('token');
|
let token = await localForage.getItem('token');
|
||||||
@ -48,7 +48,7 @@ const user = createStore({
|
|||||||
|
|
||||||
delete response.data.token;
|
delete response.data.token;
|
||||||
delete response.data.roles;
|
delete response.data.roles;
|
||||||
delete response.data.location;
|
//delete response.data.location;
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@ -69,17 +69,17 @@ const user = createStore({
|
|||||||
state.token = '';
|
state.token = '';
|
||||||
state.user = {};
|
state.user = {};
|
||||||
state.roles = [];
|
state.roles = [];
|
||||||
state.location = {};
|
//state.location = {};
|
||||||
},
|
},
|
||||||
auth_request({ state }){
|
auth_request({ state }){
|
||||||
state.status = 'loading';
|
state.status = 'loading';
|
||||||
},
|
},
|
||||||
auth_success({ state }, { token, user, roles, location }){
|
auth_success({ state }, { token, user, roles/*, location*/ }){
|
||||||
state.status = 'success';
|
state.status = 'success';
|
||||||
state.token = token;
|
state.token = token;
|
||||||
state.user = user;
|
state.user = user;
|
||||||
state.roles = roles;
|
state.roles = roles;
|
||||||
state.location = location;
|
//state.location = location;
|
||||||
},
|
},
|
||||||
auth_error({ state }){
|
auth_error({ state }){
|
||||||
state.status = 'error'
|
state.status = 'error'
|
||||||
@ -99,9 +99,9 @@ const user = createStore({
|
|||||||
roles({ state }){
|
roles({ state }){
|
||||||
return state.roles;
|
return state.roles;
|
||||||
},
|
},
|
||||||
location({ state }){
|
// location({ state }){
|
||||||
return state.location
|
// return state.location
|
||||||
},
|
// },
|
||||||
displayName({ state }){
|
displayName({ state }){
|
||||||
return state.user;
|
return state.user;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user