+
+
+ {{ $t('reg.title_verif_reg')}}
+
+
+
+
+
+ {{ risultato}}
+
+
+ {{ risultato}}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/i18n.js b/src/i18n.js
index 77b1bc0..b9c8983 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -13,6 +13,7 @@ const messages = {
repeatPassword: 'Ripeti password',
terms: "Accetti i termini e le condizioni?",
submit: "Registrati",
+ title_verif_reg: "Verifica Registrazione",
err: {
required: 'รจ richiesto',
email: 'dev\'essere una email valida',
@@ -41,6 +42,7 @@ const messages = {
repeatPassword: 'Repeat password',
terms: "Do you agree with the terms & conditions?",
submit: "Submit",
+ title_verif_reg: "Verify Registration",
err: {
required: 'is required',
email: 'must be a valid email',
diff --git a/src/plugins/axios.js b/src/plugins/axios.js
new file mode 100644
index 0000000..11b8239
--- /dev/null
+++ b/src/plugins/axios.js
@@ -0,0 +1,5 @@
+import axios from 'axios'
+
+export default ({ Vue }) => {
+ Vue.prototype.$axios = axios
+}
diff --git a/src/plugins/i18n.js b/src/plugins/i18n.js
index c25d086..144a2d6 100644
--- a/src/plugins/i18n.js
+++ b/src/plugins/i18n.js
@@ -4,14 +4,14 @@ import messages from 'src/i18n';
export default ({ app, store, Vue }) => {
Vue.use(VueI18n);
- Vue.config.lang = 'it';
+ Vue.config.lang = process.env.LANG_DEFAULT;
console.log("PLUGINS INIT....");
// Set i18n instance on app
app.i18n = new VueI18n({
- locale: 'it',
- fallbackLocale: 'it',
+ locale: process.env.LANG_DEFAULT,
+ fallbackLocale: process.env.LANG_DEFAULT,
messages
})
}
diff --git a/src/router/routes.js b/src/router/routes.js
index 0982a92..bfc55c7 100644
--- a/src/router/routes.js
+++ b/src/router/routes.js
@@ -11,6 +11,7 @@ const routes = [
{ path: '/', component: () => import('pages/Index.vue') },
{ path: '/signup', component: load('views/login/signup'), meta: { name: 'Registration' } },
{ path: '/login', component: load('views/login/login'), meta: { name: 'Login' } },
+ { path: '/vreg', component: load('views/login/vreg'), meta: { name: 'Verify Reg' } },
];
diff --git a/src/store/modules/serv_constants.js b/src/store/modules/serv_constants.js
new file mode 100644
index 0000000..ad9b3ed
--- /dev/null
+++ b/src/store/modules/serv_constants.js
@@ -0,0 +1,4 @@
+export const serv_constants = {
+ RIS_CODE_EMAIL_ALREADY_VERIFIED: -20,
+ RIS_CODE_EMAIL_VERIFIED: 1,
+};
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 1f28be4..063b81a 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -6,6 +6,13 @@ Vue.use(Vuex);
import * as types from '../mutation-types'
//import tools from '../../../tools/tools'
+function getlang(){
+ if (state.user.lang !== "")
+ return state.user.lang;
+ else
+ return process.env.LANG_DEFAULT
+}
+
export const Errori_MongoDb = {
CALLING: 10,
OK: 20,
@@ -19,24 +26,29 @@ export const state = {
_id: '',
email: '',
username: null,
+ idapp: process.env.APP_ID,
password: '',
+ lang: '',
ripetipassword: '',
dateofbirth: '',
tokens: [{
access: '',
token: ''
- }]
+ }],
+
+ verified_email: false,
},
userServer: null,
servercode: 0,
};
function sendRequest(url, method, mydata) {
+ console.log("LANG " + getlang());
const options = {
method: method,
//mode: 'no-cors',
- headers: new Headers({'content-type': 'application/json', 'x-auth': ''}),
+ headers: new Headers({'content-type': 'application/json', 'x-auth': '', 'accept-language': getlang()}),
cache: "no-cache",
body: JSON.stringify(mydata),
};
@@ -55,6 +67,7 @@ export const getters = {
getDateOfBirth: state => state.user.dateofbirth,
getUserServer: state => state.user.userServer,
getServerCode: state => state.servercode,
+ getLang: state => state.user.lang,
};
@@ -71,6 +84,9 @@ export const mutations = {
[types.USER_EMAIL]: (state, payload) => {
state.user.email = payload;
},
+ [types.USER_LANG]: (state, payload) => {
+ state.user.lang = payload;
+ },
[types.USER_DATEOFBIRTH]: (state, payload) => {
state.user.dateOfBirth = payload;
},
@@ -104,19 +120,63 @@ export const actions = {
[types.USER_EMAIL]: ({commit}, payload) => {
commit(types.USER_EMAIL, payload)
},
+ [types.USER_LANG]: ({commit}, payload) => {
+ commit(types.USER_LANG, payload)
+ },
[types.USER_DATEOFBIRTH]: ({commit}, payload) => {
commit(types.USER_DATEOFBIRTH, payload)
},
+ [types.USER_VREG]: ({commit}, paramquery) => {
+ var call = process.env.MONGODB_HOST + '/vreg';
+ console.log("CALL " + call);
+
+ let params = {
+ keyappid: process.env.PAO_APP_ID,
+ idapp: process.env.APP_ID,
+ idlink: paramquery.idlink,
+ };
+ console.log(params);
+
+ commit('setServerCode', Errori_MongoDb.CALLING);
+
+ var myres;
+
+ return sendRequest(call, "POST", params)
+ .then((res) => {
+ //console.log("RITORNO 1 ");
+ console.log(res);
+ //console.log(res.status);
+ myres = res;
+ if (myres.status === 200) {
+ return myres.json();
+ }
+ commit('setServerCode', Errori_MongoDb.ERR_GENERICO);
+ return {code: Errori_MongoDb.ERR_GENERICO, msg: 'Errore: ' + myres.status};
+
+ })
+ .then((body) => {
+ //console.log("RITORNO 2 ");
+ //commit('setServerCode', myres);
+ return {code: body.code, msg: body.msg};
+ }).catch((err) => {
+ console.log("ERROR: " + err);
+ commit('setServerCode', Errori_MongoDb.ERR_GENERICO);
+ return {code: Errori_MongoDb.ERR_GENERICO, msg: 'Errore'};
+ });
+ },
+
[types.USER_SIGNUP]: ({commit}, authData) => {
var call = process.env.MONGODB_HOST + '/users';
console.log("CALL " + call);
let params = {
keyappid: process.env.PAO_APP_ID,
+ lang: state.user.lang,
email: authData.email,
password: authData.password,
username: authData.username,
+ idapp: process.env.APP_ID,
};
console.log(params);
diff --git a/src/store/mutation-types.js b/src/store/mutation-types.js
index c2bad87..7de31bd 100644
--- a/src/store/mutation-types.js
+++ b/src/store/mutation-types.js
@@ -1,3 +1,4 @@
+
export const SET_VALUE = 'SET_VALUE';
export const SET_DEFFERED_PROMPT = 'defprompt';
export const SET_LOGIN_PAGE = 'setloginpage';
@@ -11,11 +12,11 @@ export const SET_FORM_SIGNUP = 'formsignup';
export const USER_REC = 'user_rec';
export const USER_USERNAME = 'username';
export const USER_EMAIL = 'email';
+export const USER_LANG = 'lang';
export const USER_PASSWORD = 'password';
export const USER_DATEOFBIRTH = 'dateofbirth';
export const USER_SIGNUP = 'signup';
-
-
+export const USER_VREG = 'vreg';