zhengyuxuan
2025-03-19 68af68bf2993e1c29b9165f549723701fe03a509
合并
5个文件已修改
26 ■■■■ 已修改文件
LifePayment/LifePayment.Application.Contracts/User/CreateBackClientUserInput.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/User/QrCodeLogin.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application/User/AccountService.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Domain/Common/ChannelFilter.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
LifePayment/LifePayment.Application.Contracts/User/CreateBackClientUserInput.cs
@@ -12,6 +12,11 @@
        public string Name { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        public string PhoneNumber { get; set; }
LifePayment/LifePayment.Application.Contracts/User/QrCodeLogin.cs
@@ -50,6 +50,11 @@
        public string Name { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        [RegularExpression(LifePaymentConstant.RegularExpression.UserNameEx, ErrorMessage = "账号格式不正确")]
LifePayment/LifePayment.Application/User/AccountService.cs
@@ -134,7 +134,7 @@
            return result;
        }
        public async Task<Guid> CreateAccount(CreateAccountInput input, bool isSend, bool isAdminCreate = false, string password = null)
        public async Task<Guid> CreateAccount(CreateAccountInput input, bool isSend, bool isAdminCreate = false)
        {
            if (input.ClientId == LifePaymentConstant.ClientId.Back)
            {
@@ -146,8 +146,10 @@
            CheckExtensions.IfTrueThrowUserFriendlyException(any,
                                                             CustomeErrorMessage.PhoneNumberRepeatSaveFail);
            password ??= GlobalRandom.GetRandomPassword();
            /// input.Password ??= GlobalRandom.GetRandomPassword();
            CheckExtensions.IfTrueThrowUserFriendlyException(string.IsNullOrEmpty(input.Password),
                                                             "请输入密码");
            var res = await _identityUserService.CreateAsync(new IdentityUserCreateDto
            {
                Name = input.Name,
@@ -155,7 +157,7 @@
                UserName = input.UserName,
                RoleNames = input.RoleNames,
                ClientId = input.ClientId,
                Password = password,
                Password = input.Password,
            });
            var user = await _userRepository.InsertAsync(new User
            {
LifePayment/LifePayment.Domain/Common/ChannelFilter.cs
@@ -23,7 +23,7 @@
            if (CurrentUser.ClientId == Constant.ClientType.Back)
            {
                var queryUser = UserChannleRepository.Where(r => r.UserId == CurrentUser.Id).Select(s => s.ChannleId).ToList();
                var queryResult = query.Where(s => (s.ChannelId.HasValue && queryUser.Contains(s.ChannelId.Value)) || !s.ChannelId.HasValue);
                var queryResult = query.Where(s => (s.ChannelId && queryUser.Contains(s.ChannelId.Value)) || !s.ChannelId.HasValue);
                return queryResult;
            }
LifePayment/LifePayment.HttpApi/LifePay/UserRoleController.cs
@@ -62,12 +62,18 @@
        [HttpPost]
        public async Task<int> UpdateBackClientUser(UpdateBackClientUserInput input)
        {
            var identityUser = await _identityUserService.GetAsync(input.Id);
            CheckExtensions.IfTrueThrowUserFriendlyException(identityUser == null,
                                                             "用户不存在");
            await _identityUserService.UpdateAsync(input.Id, new IdentityUserUpdateDto
            {
                Name = input.Name,
                PhoneNumber = input.PhoneNumber,
                UserName = input.UserName,
                RoleNames = input.RoleNames,
                Password = input.Password,
            });
            return await _userRoleService.UpdateBackClientUser(input);
        }