mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-06-20 18:58:16 +08:00
@ -13,4 +13,9 @@ public interface IDicContentService : IService, IDicContentModule
|
||||
/// 编辑字典内容
|
||||
/// </summary>
|
||||
Task<QueryDicContentRsp> EditAsync(EditDicContentReq req);
|
||||
|
||||
/// <summary>
|
||||
/// 通过分类键查询字典内容
|
||||
/// </summary>
|
||||
Task<List<QueryDicContentRsp>> QueryByCatalogCodeAsync(string catalogCode);
|
||||
}
|
@ -141,6 +141,17 @@ public sealed class DicContentService(BasicRepository<Sys_DicContent, long> rpo)
|
||||
return ret.Adapt<IEnumerable<QueryDicContentRsp>>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<QueryDicContentRsp>> QueryByCatalogCodeAsync(string catalogCode)
|
||||
{
|
||||
var ret = await Rpo.Orm.Select<Sys_DicContent>()
|
||||
.Include(a => a.Catalog)
|
||||
.Where(a => a.Catalog.Code == catalogCode)
|
||||
.ToListAsync()
|
||||
.ConfigureAwait(false);
|
||||
return ret.Adapt<List<QueryDicContentRsp>>();
|
||||
}
|
||||
|
||||
private ISelect<Sys_DicContent> QueryInternal(QueryReq<QueryDicContentReq> req)
|
||||
{
|
||||
var ret = Rpo.Select.WhereDynamicFilter(req.DynamicFilter).WhereDynamic(req.Filter);
|
||||
|
@ -279,17 +279,16 @@ public sealed class UserService(
|
||||
public async Task<int> ResetPasswordAsync(ResetPasswordReq req)
|
||||
{
|
||||
req.ThrowIfInvalid();
|
||||
if (await verifyCodeService.VerifyAsync(req.VerifySmsCodeReq).ConfigureAwait(false)) {
|
||||
var dto = (await Rpo.Where(a => a.Mobile == req.VerifySmsCodeReq.DestDevice)
|
||||
.ToOneAsync(a => new { a.Version, a.Id })
|
||||
.ConfigureAwait(false)).Adapt<Sys_User>() with {
|
||||
Password = req.PasswordText.Pwd()
|
||||
.Guid()
|
||||
};
|
||||
return await UpdateAsync(dto, [nameof(Sys_User.Password)]).ConfigureAwait(false);
|
||||
if (!await verifyCodeService.VerifyAsync(req.VerifySmsCodeReq).ConfigureAwait(false)) {
|
||||
throw new NetAdminInvalidOperationException(Ln.验证码不正确);
|
||||
}
|
||||
|
||||
throw new NetAdminInvalidOperationException(Ln.验证码不正确);
|
||||
var dto = (await Rpo.Where(a => a.Mobile == req.VerifySmsCodeReq.DestDevice)
|
||||
.ToOneAsync(a => new { a.Version, a.Id })
|
||||
.ConfigureAwait(false)).Adapt<Sys_User>() with {
|
||||
Password = req.PasswordText.Pwd().Guid()
|
||||
};
|
||||
return await UpdateAsync(dto, [nameof(Sys_User.Password)]).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
Reference in New Issue
Block a user