@using BootStrapComponents @using Components @using Models.Identity @using Newtonsoft.Json @using BlazorPages.Tools @page "/" @layout LayoutWithoutMenu @if (DataGotten) { }

© تمامی حقوق برای حقتو محفوظ میباشد


ورژن 1.0

@code { public bool DataGotten { set; get; } protected override async void OnInitialized() { var hasToken = await LocalStorage.ContainKeyAsync(Statics.LoginTokenKey); if (hasToken) { var token = await LocalStorage.GetItemAsStringAsync(Statics.LoginTokenKey); var res = await _userUtils.CheckLogin(goToLogin: false); var result = JsonConvert.DeserializeObject( await res.Content.ReadAsStringAsync()); if (res.IsSuccessStatusCode) { await LoadingSpinner.HideLoading(); Statics.CurrentLoginInfo = result; if (!result.HasName) NavManager.NavigateTo("/NameAndEmail"); else NavManager.NavigateTo("/dashboard"); } } DataGotten = true; StateHasChanged(); } }