- aggiornati form registrazione
- Login - Password dimenticata - Aggiorna password. - Email registrazione - Ammetti Utente
This commit is contained in:
94
src/views/login/ammetti/ammetti.ts
Executable file
94
src/views/login/ammetti/ammetti.ts
Executable file
@@ -0,0 +1,94 @@
|
||||
import { defineComponent, onMounted, ref } from 'vue';
|
||||
|
||||
import { serv_constants } from '../../../store/Modules/serv_constants';
|
||||
|
||||
import type { IAmmetti, ILinkReg } from '../../../model/other';
|
||||
import { ICallResult } from '../../../model/other';
|
||||
import { CSigninNoreg } from '../../../components/CSigninNoreg';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useGlobalStore } from '@store/globalStore';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { useUserStore } from '@store/UserStore';
|
||||
import { tools } from '@tools';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Ammetti',
|
||||
components: { CSigninNoreg },
|
||||
|
||||
setup(props) {
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const $router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const globalStore = useGlobalStore();
|
||||
const userStore = useUserStore();
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const isLoading = ref(false);
|
||||
|
||||
const username = ref('')
|
||||
|
||||
const risultato = ref('---');
|
||||
const riscode = ref(0);
|
||||
|
||||
function myrisultato() {
|
||||
return risultato;
|
||||
}
|
||||
|
||||
function giaammesso() {
|
||||
return riscode.value !== serv_constants.RIS_CODE_AMMESSO;
|
||||
}
|
||||
|
||||
function ammettiok() {
|
||||
return riscode.value === serv_constants.RIS_CODE_AMMESSO;
|
||||
}
|
||||
|
||||
function load() {
|
||||
console.log('load Ammetti');
|
||||
|
||||
isLoading.value = true
|
||||
|
||||
username.value = (route.params.username) ? route.params.username.toString() : '';
|
||||
let param: IAmmetti = { token: '', username: '' };
|
||||
if (route.params.token) param = { token: route.params.token.toString(), username: username.value };
|
||||
|
||||
// console.log('idlink = ', param)
|
||||
return userStore
|
||||
.ammetti(param)
|
||||
.then((ris: any) => {
|
||||
riscode.value = ris.code;
|
||||
risultato.value = ris.msg;
|
||||
isLoading.value = false
|
||||
})
|
||||
.catch((err: any) => {
|
||||
console.log('ERR = ' + err);
|
||||
isLoading.value = false
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
load();
|
||||
});
|
||||
|
||||
const goToProfile = () => {
|
||||
// Naviga al profilo del membro ammesso
|
||||
router.push(`/my/${username.value}`);
|
||||
};
|
||||
|
||||
const goHome = () => {
|
||||
router.push('/');
|
||||
};
|
||||
return {
|
||||
tools,
|
||||
ammettiok,
|
||||
giaammesso,
|
||||
myrisultato,
|
||||
t,
|
||||
isLoading,
|
||||
goHome,
|
||||
goToProfile,
|
||||
};
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user