From f9bc1d677008142990cdef0b824700a4bcb72a71 Mon Sep 17 00:00:00 2001 From: zhengyuxuan <zhengyuxuan1995> Date: 星期四, 27 三月 2025 17:10:05 +0800 Subject: [PATCH] fix:用户登录 --- LifePayment/LifePayment.Application/User/AccountService.cs | 28 +++++++++++++++++----------- 1 files changed, 17 insertions(+), 11 deletions(-) diff --git a/LifePayment/LifePayment.Application/User/AccountService.cs b/LifePayment/LifePayment.Application/User/AccountService.cs index 11dcf39..7ddb6db 100644 --- a/LifePayment/LifePayment.Application/User/AccountService.cs +++ b/LifePayment/LifePayment.Application/User/AccountService.cs @@ -103,17 +103,9 @@ /// <param name="input"></param> /// <returns></returns> /// <exception cref="UserFriendlyException"></exception> - public async Task<Guid> LifePayPhoneMesssageCodeLogin(LifePayPhoneMesssageCodeLoginInput input) + public async Task<LifePayPhoneMesssageCodeLoginOutput> LifePayPhoneMesssageCodeLogin(LifePayPhoneMesssageCodeLoginInput input) { - //var vcodeType = VerificationCodeBusinessTypeEnum.LifePayPhoneMesssageCodeLogin; - - //var checkResult = await _verificationCodeManager.CheckVerificationCodeByBusinessType(vcodeType, - // input.PhoneNumber, - // input.Code, - // true); - //CheckExtensions.IfTrueThrowUserFriendlyException(!checkResult, - // CustomeErrorMessage.SometingWrongOrSometing, "楠岃瘉鐮�", "宸插け鏁�"); - + string[] channlesNum = new string[0]; var lifeUser = await _lifePayUserRepository.Where(x => x.PhoneNumber == input.PhoneNumber).FirstOrDefaultAsync(); if (lifeUser == null) { @@ -133,8 +125,22 @@ lifeUser.LastLoginTime = DateTime.Now; await _lifePayUserRepository.UpdateAsync(lifeUser); } + var backClientUser = await _userRepository.Where(x => x.ClientId == Constant.ClientType.Back + && x.PhoneNumber == input.PhoneNumber).FirstOrDefaultAsync(); + if (backClientUser != null) + { + channlesNum = await _userChannleRep.Where(x => x.UserId == backClientUser.Id).Select(s => s.ChannleId).ToArrayAsync(); + } - return lifeUser.Id; + LifePayPhoneMesssageCodeLoginOutput result = new LifePayPhoneMesssageCodeLoginOutput() + { + UserId = lifeUser.Id, + IsBackClientUser = backClientUser == null ? false : true, + ChannlesNum = channlesNum + }; + + + return result; } public async Task<IdentityModelTokenCacheItem> GetTokenForWeb(AccessRequestDto accessRequestDto, string webClientIp) -- Gitblit v1.9.1