- starting project list...
- ordering some functions
- fix error TS2339
quasar.extensions.json was the problem !
inside had:
{
"@quasar/typescript": {
"webpack": "plugin",
"rename": true
}
}
This commit is contained in:
@@ -19,7 +19,6 @@ const state: IUserState = {
|
||||
userId: '',
|
||||
email: '',
|
||||
username: '',
|
||||
idapp: process.env.APP_ID,
|
||||
password: '',
|
||||
lang: '',
|
||||
repeatPassword: '',
|
||||
@@ -28,6 +27,7 @@ const state: IUserState = {
|
||||
categorySel: 'personal',
|
||||
servercode: 0,
|
||||
x_auth_token: '',
|
||||
isLogged: false,
|
||||
isAdmin: false
|
||||
}
|
||||
|
||||
@@ -79,14 +79,14 @@ namespace Getters {
|
||||
},
|
||||
get getServerCode() {
|
||||
return getServerCode()
|
||||
}
|
||||
},
|
||||
// get fullName() { return fullName();},
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace Mutations {
|
||||
function authUser(state: IUserState, data: IUserState ) {
|
||||
function authUser(state: IUserState, data: IUserState) {
|
||||
state.userId = data.userId
|
||||
state.username = data.username
|
||||
if (data.verified_email) {
|
||||
@@ -221,8 +221,6 @@ namespace Actions {
|
||||
async function resetpwd(context, paramquery: IUserState) {
|
||||
|
||||
const usertosend = {
|
||||
keyappid: process.env.PAO_APP_ID,
|
||||
idapp: process.env.APP_ID,
|
||||
email: paramquery.email,
|
||||
password: paramquery.password,
|
||||
tokenforgot: paramquery.tokenforgot
|
||||
@@ -245,8 +243,6 @@ namespace Actions {
|
||||
async function requestpwd(context, paramquery: IUserState) {
|
||||
|
||||
const usertosend = {
|
||||
keyappid: process.env.PAO_APP_ID,
|
||||
idapp: process.env.APP_ID,
|
||||
email: paramquery.email
|
||||
}
|
||||
console.log(usertosend)
|
||||
@@ -265,8 +261,6 @@ namespace Actions {
|
||||
|
||||
async function vreg(context, paramquery: ILinkReg) {
|
||||
const usertosend = {
|
||||
keyappid: process.env.PAO_APP_ID,
|
||||
idapp: process.env.APP_ID,
|
||||
idlink: paramquery.idlink
|
||||
}
|
||||
console.log(usertosend)
|
||||
@@ -301,12 +295,10 @@ namespace Actions {
|
||||
return bcrypt.hash(authData.password, bcrypt.genSaltSync(12))
|
||||
.then((hashedPassword: string) => {
|
||||
const usertosend = {
|
||||
keyappid: process.env.PAO_APP_ID,
|
||||
lang: mylang,
|
||||
email: authData.email,
|
||||
password: String(hashedPassword),
|
||||
username: authData.username,
|
||||
idapp: process.env.APP_ID
|
||||
}
|
||||
|
||||
console.log(usertosend)
|
||||
@@ -371,7 +363,7 @@ namespace Actions {
|
||||
try {
|
||||
if ('serviceWorker' in navigator) {
|
||||
sub = await navigator.serviceWorker.ready
|
||||
.then(function(swreg) {
|
||||
.then(function (swreg) {
|
||||
console.log('swreg')
|
||||
const sub = swreg.pushManager.getSubscription()
|
||||
return sub
|
||||
@@ -393,8 +385,6 @@ namespace Actions {
|
||||
const usertosend = {
|
||||
username: authData.username,
|
||||
password: authData.password,
|
||||
idapp: process.env.APP_ID,
|
||||
keyappid: process.env.PAO_APP_ID,
|
||||
lang: state.lang,
|
||||
subs: sub,
|
||||
options
|
||||
@@ -487,13 +477,7 @@ namespace Actions {
|
||||
|
||||
await GlobalStore.actions.clearDataAfterLogout()
|
||||
|
||||
const usertosend = {
|
||||
keyappid: process.env.PAO_APP_ID,
|
||||
idapp: process.env.APP_ID
|
||||
}
|
||||
|
||||
console.log(usertosend)
|
||||
const riscall = await Api.SendReq('/users/me/token', 'DELETE', usertosend)
|
||||
const riscall = await Api.SendReq('/users/me/token', 'DELETE', null)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
}).then(() => {
|
||||
@@ -510,6 +494,7 @@ namespace Actions {
|
||||
|
||||
async function setGlobal(loggedWithNetwork: boolean) {
|
||||
state.isLogged = true
|
||||
console.log('state.isLogged')
|
||||
GlobalStore.mutations.setleftDrawerOpen(localStorage.getItem(tools.localStorage.leftDrawerOpen) === 'true')
|
||||
GlobalStore.mutations.setCategorySel(localStorage.getItem(tools.localStorage.categorySel))
|
||||
|
||||
@@ -523,7 +508,7 @@ namespace Actions {
|
||||
|
||||
async function autologin_FromLocalStorage(context) {
|
||||
try {
|
||||
// console.log('*** autologin_FromLocalStorage ***')
|
||||
console.log('*** autologin_FromLocalStorage ***')
|
||||
// INIT
|
||||
|
||||
UserStore.state.lang = tools.getItemLS(tools.localStorage.lang)
|
||||
@@ -566,6 +551,22 @@ namespace Actions {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
async function refreshUserInfos(){
|
||||
let {token, refresh_token} = JWT.fetch();
|
||||
if (!!token) {
|
||||
try {
|
||||
let { data } = await Api.checkSession({token, refresh_token});
|
||||
JWT.set(data);
|
||||
let userData = await jwtDecode(data.token);
|
||||
LoginModule.mutations.updateUserInfos({userData, token: data.token});
|
||||
} catch(e) {
|
||||
Mutations.mutations.disconnectUser();
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
export const actions = {
|
||||
autologin_FromLocalStorage: b.dispatch(autologin_FromLocalStorage),
|
||||
logout: b.dispatch(logout),
|
||||
|
||||
Reference in New Issue
Block a user