public async Task UserLoginAsync() { var input = new Input { Extens = new Dictionary <string, string> { { "UserName", UserName }, { "Password", Secret.DesEncrypt(Password) } } }; var re = await Http.PostHttpAsync <Result <JobUserEntity>, Input>($"job/login", input); if (re.Success) { await JSRuntime.DoVoidAsync("toastrs", new[] { "success", "登录", re.Message }); re.Data.Password = "******"; await SessionStorage.SetItemAsync(SessionStorage.GetId(), re.Data); if (Remember) { re.Data.Password = Secret.DesEncrypt(Password); await LocalStorage.SetItemAsync($"__User", re.Data); } Nav.NavigateTo("/"); } else { await JSRuntime.DoVoidAsync("toastrs", new[] { "error", "登录", re.Message }); } }
protected override async Task OnInitializedAsync() { await UserCheckAsync(); await Load(); await JSRuntime.DoVoidAsync("initDataTable", new[] { "#task" }); }
public async Task <Result <JobTaskStatus> > SingleSetting(SingleType type, string name, long sid) { var re = await Http.PostHttpAsync <Result <JobTaskStatus> >($"job/task/{type}/{sid}", nodeName : await SessionStorage.GetItemAsync <string>("nodename")); if (re.Success) { await JSRuntime.DoVoidAsync("toastrs", new[] { "success", name, re.Message }); await Load(); } else { await JSRuntime.DoVoidAsync("toastrs", new[] { "error", name, re.Message }); } return(re); }
protected override async Task OnInitializedAsync() { await JSRuntime.DoVoidAsync("init"); }
public async Task Startd(string name) { await SessionStorage.SetItemAsync("nodename", name); await JSRuntime.DoVoidAsync("toastrs", new[] { "success", "节点选择", $"已选节点:{name}" }); }