feat(login): selectDepart接口补充部门ID和名称,支持前端反馈表单自动填充

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wsm
2026-07-14 10:56:00 +08:00
co-authored by Claude Opus 4.7
parent e1a5a35a24
commit 23cda60b5d
@@ -327,6 +327,16 @@ public class LoginController {
//设置用户登录部门和登录租户 //设置用户登录部门和登录租户
this.sysUserService.updateUserDepart(username, orgCode,tenantId); this.sysUserService.updateUserDepart(username, orgCode,tenantId);
SysUser sysUser = sysUserService.getUserByName(username); SysUser sysUser = sysUserService.getUserByName(username);
// 查询部门信息并设置到 userInfo 中,前端反馈表单等处需要用到部门ID和名称
if (oConvertUtils.isNotEmpty(orgCode)) {
SysDepart depart = sysDepartService.lambdaQuery()
.eq(SysDepart::getOrgCode, orgCode)
.one();
if (depart != null) {
sysUser.setOrgCodeTxt(depart.getDepartName());
sysUser.setDepartIds(depart.getId());
}
}
JSONObject obj = new JSONObject(); JSONObject obj = new JSONObject();
obj.put("userInfo", sysUser); obj.put("userInfo", sysUser);
result.setResult(obj); result.setResult(obj);