Merged PR 148: Bug fetch-user

This commit is contained in:
2025-06-05 08:55:40 +00:00
4 changed files with 16 additions and 8 deletions

View File

@@ -41,9 +41,11 @@ var auth = createAuth({
router: driverRouterVueRouter router: driverRouterVueRouter
}, },
options:{ options:{
notFoundRedirect: '/auth/login', // notFoundRedirect: '/auth/login',
authRedirect: '/auth/login', // authRedirect: '/auth/login',
loginData: {url: '/api/auth/login', method: 'POST', redirect: '/'}, authRedirect: false, // niente redirect automatici
notFoundRedirect: false,
loginData: {url: '/api/auth/login', method: 'POST', redirect: '/home'},
logoutData: {url: '/api/auth/logout', redirect: '/auth/login'}, logoutData: {url: '/api/auth/logout', redirect: '/auth/login'},
fetchData: {url: '/api/auth/fetch-user', method: 'GET', enabled: false}, fetchData: {url: '/api/auth/fetch-user', method: 'GET', enabled: false},
refreshData: {url: '/api/auth/refresh-token', method: 'GET', enabled: false} refreshData: {url: '/api/auth/refresh-token', method: 'GET', enabled: false}

View File

@@ -7,6 +7,11 @@ const router = createRouter({
routes: [ routes: [
{ {
path: '/', path: '/',
redirect: '/auth/login',
meta: { auth: false }
},
{
path: '/home',
component: AppLayout, component: AppLayout,
meta: { meta: {
auth: true auth: true

View File

@@ -297,10 +297,10 @@ const showFileContent = (base64String, type) => {
const jsonObject = JSON.parse(textContent); // Parse JSON const jsonObject = JSON.parse(textContent); // Parse JSON
fileContent.value = JSON.stringify(jsonObject, null, 2); // Formatta JSON fileContent.value = JSON.stringify(jsonObject, null, 2); // Formatta JSON
} else { } else {
fileContent.value = 'Tipo di file non supportato.'; fileContent.value = 'File type not supported.';
} }
} catch (error) { } catch (error) {
fileContent.value = 'Errore durante la decodifica o il parsing del file.'; fileContent.value = 'Error while parsing the file.';
console.error(error); console.error(error);
} }
}; };

View File

@@ -36,7 +36,7 @@
auto auto
:showUploadButton="false" :showUploadButton="false"
:showCancelButton="false" :showCancelButton="false"
:maxFileSize="20971520" :maxFileSize="52428800"
:invalidFileSizeMessage="'Invalid file size, file size should be smaller than 20 MB'" :invalidFileSizeMessage="'Invalid file size, file size should be smaller than 20 MB'"
v-model:files="uploadedFiles" v-model:files="uploadedFiles"
@before-send="onBeforeSend" @before-send="onBeforeSend"
@@ -100,7 +100,7 @@
auto auto
:showUploadButton="false" :showUploadButton="false"
:showCancelButton="false" :showCancelButton="false"
:maxFileSize="20971520" :maxFileSize="52428800"
v-model:files="uploadedFiles" v-model:files="uploadedFiles"
@before-send="onBeforeSend" @before-send="onBeforeSend"
> >
@@ -332,6 +332,7 @@ const uploadedFiles = ref([]);
const numberPrFiles = ref(0); const numberPrFiles = ref(0);
const acceptedFormats = ref('.docx'); const acceptedFormats = ref('.docx');
// :url="`http://localhost:8081/uploadListFiles/${folderName}`" // :url="`http://localhost:8081/uploadListFiles/${folderName}`"
const errored_execution = ref(false);
// Stato per l'ID univoco della cartella // Stato per l'ID univoco della cartella
const uniqueFolderId = ref(generateUniqueId()); const uniqueFolderId = ref(generateUniqueId());
@@ -525,7 +526,7 @@ const openDebug = () => {
}; };
const pollBackendAPI = () => { const pollBackendAPI = () => {
const errored_execution = ref(false); errored_execution.value = false;
axios.get('/scenarios/getExecutionProgress/' + exec_id.value).then((response) => { axios.get('/scenarios/getExecutionProgress/' + exec_id.value).then((response) => {
if (response.data.status == 'OK' || response.data.status == 'ERROR') { if (response.data.status == 'OK' || response.data.status == 'ERROR') {
console.log('Condition met, stopping polling.'); console.log('Condition met, stopping polling.');