minor fix

This commit is contained in:
zaccaria.majid
2022-11-15 17:39:04 +01:00
parent 1a153ef4be
commit b141f5cfa2
4 changed files with 54 additions and 31 deletions
+8
View File
@@ -67,10 +67,17 @@ namespace MP.INVE.Data
int answ = 0;
if (HttpContextAccessor.HttpContext != null)
{
#if false
var token = HttpContextAccessor.HttpContext.Request.Cookies["userId_token"];
if (token != null)
{
int.TryParse(token, out answ);
}
#endif
var currUser = UserDTO(matrOpr, authKey);
if (currUser != null)
{
answ = currUser.MatrOpr;
}
}
return answ;
@@ -167,6 +174,7 @@ namespace MP.INVE.Data
bool fatto = false;
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string source = "REDIS";
// cerco in redis...
string rawData = JsonConvert.SerializeObject(userData);
+1 -1
View File
@@ -66,7 +66,7 @@ namespace MP.INVE.Pages
LServ.UserDTOSave(oprDto);
}
NavManager.NavigateTo("/Starter", true);
NavManager.NavigateTo("Starter", true);
}
else
{
-30
View File
@@ -9,34 +9,4 @@
@*<img src="https://qrcode.steamware.net//HOME/QR_site/JSON?val={'baseUrl':'https://iis02.egalware.com/MP/MAG/SMART/PLScanner?{0}','parameters':['MatrOpr=102']}" />*@
@code {
[Inject]
private IConfiguration Configuration { get; set; } = null!;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", rawCode);
}
}
protected string BaseUrlTab
{
get => $"{Configuration["ServerConf:BaseUrl"]}";
}
protected string rawCode
{
get
{
string answ = "";
answ = $"{BaseUrlTab}MatrOpr={101}&UserAuthKey={12345}";
return answ;
}
}
}
+45
View File
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP.INVE;
using MP.INVE.Shared;
using MP.INVE.Components;
namespace MP.INVE.Pages
{
public partial class Starter
{
[Inject]
private IConfiguration Configuration { get; set; } = null !;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}");
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", rawCode);
}
}
protected string BaseUrlTab { get => $"{Configuration["ServerConf:BaseUrl"]}"; }
protected string rawCode
{
get
{
string answ = "";
answ = $"{BaseUrlTab}MatrOpr={101}&UserAuthKey={12345}";
return answ;
}
}
}
}