fix passaggio sessionId in jumper
This commit is contained in:
@@ -20,13 +20,16 @@ using MP.INVE.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.DTO;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Blazored.SessionStorage;
|
||||
|
||||
namespace MP.INVE.Pages
|
||||
{
|
||||
public partial class Jumper
|
||||
{
|
||||
[Inject]
|
||||
protected ILocalStorageService localStorage { get; set; } = null!;
|
||||
protected ILocalStorageService localStorage { get; set; } = null!;
|
||||
[Inject]
|
||||
protected ISessionStorageService sessionStorage { get; set; } = null!;
|
||||
[Inject]
|
||||
protected NavigationManager NavManager { get; set; } = null!;
|
||||
[Inject]
|
||||
@@ -37,14 +40,16 @@ namespace MP.INVE.Pages
|
||||
private List<AnagOperatoriModel> operatore = new List<AnagOperatoriModel>();
|
||||
protected string idOPeratore { get; set; } = null!;
|
||||
protected string authKey { get; set; } = null!;
|
||||
protected int inveSessionId { get; set; } = 0;
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("MatrOpr", out var _matrOpr) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("UserAuthKey", out var _authKey))
|
||||
if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("MatrOpr", out var _matrOpr) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("UserAuthKey", out var _authKey) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("idSessione", out var _inveSessionId))
|
||||
{
|
||||
idOPeratore = _matrOpr;
|
||||
authKey = _authKey;
|
||||
inveSessionId = int.Parse(_inveSessionId);
|
||||
}
|
||||
string pw = MIService.DeriptData(authKey);
|
||||
logged = MIService.loginOperatore(int.Parse(idOPeratore), pw);
|
||||
@@ -69,8 +74,9 @@ namespace MP.INVE.Pages
|
||||
};
|
||||
|
||||
await localStorage.SetItemAsync("MatrOpr", currOpr);
|
||||
NavManager.NavigateTo("Acquisizione");
|
||||
await sessionStorage.SetItemAsync("idSessione", inveSessionId);
|
||||
}
|
||||
NavManager.NavigateTo($"Acquisizione?idSessione={inveSessionId}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user