From 82551155605ed6cb426195093b278c1900dc764d Mon Sep 17 00:00:00 2001 From: Perea Date: Wed, 1 Oct 2025 17:08:45 +0200 Subject: [PATCH] prueba --- .../Layout/ConfiguracionLayout.razor | 71 +++++++++++++------ .../Imprimir/LicitacionesURBANImprimir.razor | 16 +++-- .../Components/Pages/LicitacionesURBAN.razor | 2 +- 3 files changed, 59 insertions(+), 30 deletions(-) diff --git a/HerramientaCASA/Components/Layout/ConfiguracionLayout.razor b/HerramientaCASA/Components/Layout/ConfiguracionLayout.razor index 83f0e03..af1319d 100644 --- a/HerramientaCASA/Components/Layout/ConfiguracionLayout.razor +++ b/HerramientaCASA/Components/Layout/ConfiguracionLayout.razor @@ -7,6 +7,7 @@ @using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage @inject ProtectedLocalStorage ProtectedLocalStore @inject UserState userState +@inject IJSRuntime JS @@ -107,31 +108,55 @@ @code { - protected override async Task OnInitializedAsync() - { - // Redirigir al home si no hay token y la ruta no es pública - if (userState.idUser == 0) -) - { - Navigation.NavigateTo("/", true); - } - } - - - // protected override void OnAfterRender(bool firstRender) + // protected override async Task OnInitializedAsync() // { - // if (firstRender) + // // Redirigir al home si no hay token y la ruta no es pública + // if (userState.idUser == 0) // { - // string? urlAnterior = HttpContextAccessor.HttpContext?.Request.Headers["Referer"].ToString(); - // string rutaActual = Navigation.ToBaseRelativePath(Navigation.Uri); - - // if (rutaActual != "Denegado") - // { - // if (string.IsNullOrEmpty(urlAnterior) || urlAnterior.Contains("cacoa.es")) - // { - // Navigation.NavigateTo("/Denegado", true); - // } - // } + // Navigation.NavigateTo("/", true); // } // } + + + string? urlAnterior = ""; + + bool urlVaida = true; + string rutaActual = ""; + + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + urlAnterior = await JS.InvokeAsync("eval", "document.referrer"); + + + if (!string.IsNullOrEmpty(urlAnterior)) + { + + rutaActual = Navigation.ToBaseRelativePath(Navigation.Uri); + + + if (rutaActual != "Denegado") + { + if (!urlAnterior.Contains("cacoa.es")) + { + Navigation.NavigateTo("/Denegado", true); + } + } + + } + else + { + Navigation.NavigateTo("/Denegado", true); + } + + + if (userState.idUser == 0) + { + Navigation.NavigateTo("/", true); + } + StateHasChanged(); + } + } } diff --git a/HerramientaCASA/Components/Pages/Imprimir/LicitacionesURBANImprimir.razor b/HerramientaCASA/Components/Pages/Imprimir/LicitacionesURBANImprimir.razor index eb01e09..b97dd39 100644 --- a/HerramientaCASA/Components/Pages/Imprimir/LicitacionesURBANImprimir.razor +++ b/HerramientaCASA/Components/Pages/Imprimir/LicitacionesURBANImprimir.razor @@ -116,10 +116,10 @@ @* TABLA DE DATOS OPCIONALES *@ -
+
-
+
Documentación Opcional:
@@ -199,8 +199,9 @@
+ @* FASES *@ -
+
Fases: @@ -249,7 +250,7 @@
@* INNOVACIÓN INSTRUMENTOS*@ -
+
Innovacion de los instrumentos

@@ -285,7 +286,10 @@

@* Solvencia tecnica *@ -
+ +
+
+
Solvencia técnica:
@@ -441,7 +445,7 @@ if (objetoLicitacionUrban.TrabajoProfesional.idTipoDocumentacion != 0) { - espacioDocumentos = "margin-top:300px;"; + espacioDocumentos = "margin-top:50px;"; } else { diff --git a/HerramientaCASA/Components/Pages/LicitacionesURBAN.razor b/HerramientaCASA/Components/Pages/LicitacionesURBAN.razor index 95675d8..174a6f2 100644 --- a/HerramientaCASA/Components/Pages/LicitacionesURBAN.razor +++ b/HerramientaCASA/Components/Pages/LicitacionesURBAN.razor @@ -53,7 +53,7 @@
- @* *@ +