12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using AntDesign;
- using Microsoft.AspNetCore.Components;
- using Microsoft.AspNetCore.Components.Authorization;
- using System.Net.Http;
- using System.Net.Http.Json;
- using wispro.sp.share.webViewObject;
- using wispro.sp.web.Services;
- using System.IdentityModel.Tokens.Jwt;
- using Microsoft.IdentityModel.Tokens;
- using System.Linq;
- using System.Security.Claims;
- using Blazored.LocalStorage;
- using System;
- using System.Text.Json;
- namespace wispro.sp.web.Pages
- {
- public partial class LoginPages
- {
- [Inject] public HttpClient Http { get; set; }
- [Inject] public MessageService MsgSvr { get; set; }
- //[Inject] public AuthenticationStateProvider AuthProvider { get; set; }
- [Inject] public IUserService _UserService { get; set; }
- [Inject] public IAuthService authService { get; set; }
- [Inject] public NavigationManager navigation { get; set; }
- loginDto model = new loginDto();
- bool isLoading;
- async void OnLogin()
- {
- isLoading = true;
-
- bool result = await authService.LoginAsync(model);
-
- if (result)
- {
- if (model.Password == "12345678")
- {
- navigation.NavigateTo("/ChangePassword/true");
- }
- else
- {
- navigation.NavigateTo("/Home");
- }
- }
- else
- {
- _ = MsgSvr.Error($"用户名或密码错误");
-
- }
-
- isLoading = false;
- }
- }
- }
|