feat(config): 添加配置数据种子和根据key查询配置功能
- 添加初始密码配置项的种子数据 (sys.user.initPassword: 123456) - 在 ConfigService 中新增 GetConfigKeyAsync 方法支持根据key查询配置值
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
using Volo.Abp.Application.Services;
|
||||
@@ -61,5 +62,18 @@ namespace Yi.Framework.Rbac.Application.Services
|
||||
throw new UserFriendlyException(ConfigConst.Exist);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据key查配置
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
///
|
||||
[Route("config/config-key/{configKey}")]
|
||||
public async Task<string> GetConfigKeyAsync(string configKey)
|
||||
{
|
||||
var entity = await _repository.GetAsync(x => x.ConfigKey == configKey);
|
||||
return entity.ConfigValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user