using EasyTemplate.Tool; using Microsoft.JSInterop; namespace EasyTemplate.Blazor.Web.Components.Pages.Account.Setting; public partial class Setting { private void SelectKey(MenuItem item) { TSelectKey = item.Key; } protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); } protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { await NavigationManager.RedirectLogin(IJSRuntime); Global.CurrentUser = User.GetFirst(x => x.Id == Global.CurrentUser.Id); } } private readonly Dictionary _menuMap = new Dictionary { {"base", "基本设置"}, //{"security", "安全设置"}, {"binding", "账号绑定"}, //{"notification", "消息提示"}, }; private string TSelectKey = "base"; /// /// /// [Inject] private SqlSugarRepository User { get; set; } /// /// /// [Inject] NavigationManager NavigationManager { get; set; } /// /// /// [Inject] IJSRuntime IJSRuntime { get; set; } }