333
This commit is contained in:
parent
0d094db7d3
commit
eaa5f3f610
|
|
@ -25,25 +25,27 @@ namespace ZR.Admin.WebApi.Controllers
|
||||||
private IWebHostEnvironment WebHostEnvironment;
|
private IWebHostEnvironment WebHostEnvironment;
|
||||||
private ISysFileService SysFileService;
|
private ISysFileService SysFileService;
|
||||||
private readonly IStringLocalizer<SharedResource> _localizer;
|
private readonly IStringLocalizer<SharedResource> _localizer;
|
||||||
|
public readonly ISysDeptService _deptService;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// CommonController 构造函数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="stringLocalizer"></param>
|
/// <param name="stringLocalizer"></param>
|
||||||
/// <param name="options"></param>
|
/// <param name="options"></param>
|
||||||
/// <param name="webHostEnvironment"></param>
|
/// <param name="webHostEnvironment"></param>
|
||||||
/// <param name="fileService"></param>
|
/// <param name="fileService"></param>
|
||||||
|
/// <param name="deptService"></param>
|
||||||
public CommonController(
|
public CommonController(
|
||||||
IStringLocalizer<SharedResource> stringLocalizer,
|
IStringLocalizer<SharedResource> stringLocalizer,
|
||||||
IOptions<OptionsSetting> options,
|
IOptions<OptionsSetting> options,
|
||||||
IWebHostEnvironment webHostEnvironment,
|
IWebHostEnvironment webHostEnvironment,
|
||||||
ISysFileService fileService)
|
ISysFileService fileService,
|
||||||
|
ISysDeptService deptService)
|
||||||
{
|
{
|
||||||
WebHostEnvironment = webHostEnvironment;
|
WebHostEnvironment = webHostEnvironment;
|
||||||
SysFileService = fileService;
|
SysFileService = fileService;
|
||||||
OptionsSetting = options.Value;
|
OptionsSetting = options.Value;
|
||||||
_localizer = stringLocalizer;
|
_localizer = stringLocalizer;
|
||||||
|
_deptService = deptService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -212,7 +214,14 @@ namespace ZR.Admin.WebApi.Controllers
|
||||||
public async Task<IActionResult> GetConfig()
|
public async Task<IActionResult> GetConfig()
|
||||||
{
|
{
|
||||||
var file = await SysFileService.AsQueryable().Where(x => x.ClassifyType == "watermark").FirstAsync();
|
var file = await SysFileService.AsQueryable().Where(x => x.ClassifyType == "watermark").FirstAsync();
|
||||||
return SUCCESS(new { logo = file?.AccessUrl ?? "" });
|
var topDept = await _deptService.AsQueryable().Where(it => it.ParentId == 0 && it.DelFlag == 0 && it.Status == 0).FirstAsync();
|
||||||
|
List<string> deptList = new List<string>();
|
||||||
|
if (topDept != null)
|
||||||
|
{
|
||||||
|
var children = await _deptService.AsQueryable().Where(it => it.ParentId == topDept.DeptId && it.DelFlag == 0 && it.Status == 0).Select(it => it.DeptName).ToListAsync();
|
||||||
|
deptList = children;
|
||||||
|
}
|
||||||
|
return SUCCESS(new { logo = file?.AccessUrl ?? "", deptList });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user