zhengyiming
2025-03-31 481c2276623c9f12ce5452334422b8b1322fed45
LifePayment/LifePayment.Application/User/UserRoleService.cs
@@ -62,7 +62,7 @@
                           from c in _channleRepository.Where(s => s.ChannlesNum == uc.ChannleId)
                        select new UserChannleDto
                        {
                            Id = c.ChannlesNum,
                            Id = c.Id,
                            Name = c.ChannlesName,
                        },
                Remark = u.Remark,
@@ -103,10 +103,16 @@
            List<UserChannle> userChannles = new List<UserChannle>();
            foreach (var item in input.ChannlesId)
            {
                var channleNum = item;
                if (IsGuid(channleNum))
                {
                    channleNum = await _channleRepository.Where(x => x.Id == Guid.Parse(item)).Select(s => s.ChannlesNum).FirstOrDefaultAsync();
                }
                userChannles.Add(new UserChannle()
                {
                    Id = Guid.NewGuid(),
                    ChannleId = item,
                    ChannleId = channleNum,
                    UserId = entity.Id
                });
            }
@@ -221,5 +227,11 @@
            await _roleRepository.DeleteAsync(id);
            return Constant.SUCCESS;
        }
        private bool IsGuid(string input)
        {
            Guid guidOutput;
            return Guid.TryParse(input, out guidOutput);
        }
    }
}
}