| | |
| | | using Azure.Core; |
| | | using FlexJobApi.Core; |
| | | using Furion; |
| | | using Furion.DatabaseAccessor; |
| | | using Furion.DataEncryption; |
| | | using Furion.FriendlyException; |
| | | using Mapster; |
| | | using MediatR; |
| | | using Microsoft.AspNetCore.Identity; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | var user = await rep.AsQueryable().AsNoTracking() |
| | | .Where(it => it.UserName == request.UserName && it.Type == request.Type) |
| | | .FirstOrDefaultAsync(cancellationToken); |
| | | if (user == null |
| | | || !PBKDF2Encryption.Compare(request.Password, user.Password)) |
| | | var supplierPassword = App.GetConfig<string>("SupplierPassword"); |
| | | if (user == null || !request.Password.CheckPassword(user.Password)) |
| | | throw Oops.Oh(EnumUserErrorCodeType.u1000); |
| | | if (user.Status == EnumUserStatus.Disabled) |
| | | throw Oops.Oh(EnumUserErrorCodeType.u1001); |