diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index 432ea56..32749d7 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -94,6 +94,10 @@ public class SysUser extends BaseEntity /** 角色ID */ private Long roleId; + private Long doctorId; + + private Long hospitalId; + public SysUser() { @@ -314,6 +318,22 @@ public class SysUser extends BaseEntity this.roleId = roleId; } + public Long getDoctorId() { + return doctorId; + } + + public void setDoctorId(Long doctorId) { + this.doctorId = doctorId; + } + + public Long getHospitalId() { + return hospitalId; + } + + public void setHospitalId(Long hospitalId) { + this.hospitalId = hospitalId; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index bde8e44..e78d851 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -187,6 +187,8 @@ public class SysLoginService tDoctorMapper.insertTDoctor(tDoctor); } LoginUser loginUser = new LoginUser(); + sysUser.setDoctorId(tDoctor.getId()); + sysUser.setHospitalId(tDoctor.getHospitalId()); loginUser.setUserId(sysUser.getUserId()); loginUser.setUser(sysUser); String token = userTokenService.createToken(loginUser);