|
|
@@ -25,6 +25,8 @@ import cn.tr.module.sys.oauth2.dto.OAuth2PswReqDTO;
|
|
|
import cn.tr.module.sys.oauth2.mapper.OAuth2Mapper;
|
|
|
import cn.tr.module.sys.oauth2.psw.operator.AbstractOAuth2PswUserOperator;
|
|
|
import cn.tr.module.sys.oauth2.psw.operator.LoginOAuth2PswUserOperator;
|
|
|
+import cn.tr.module.sys.tenant.po.SysTenantPO;
|
|
|
+import cn.tr.module.sys.tenant.repository.SysTenantRepository;
|
|
|
import cn.tr.module.sys.user.dto.SysUserDTO;
|
|
|
import cn.tr.module.sys.user.po.SysUserPO;
|
|
|
import cn.tr.module.sys.user.repository.SysUserRepository;
|
|
|
@@ -63,6 +65,9 @@ public class DoctorAppLoginOperator extends AbstractOAuth2PswUserOperator {
|
|
|
private IBizSmsService smsService;
|
|
|
@Autowired
|
|
|
private ISysUserService sysUserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SysTenantRepository tenantRepository;
|
|
|
private static final String LOGIN_TYPE = "APP";
|
|
|
@Override
|
|
|
public String auth(OAuth2PswReqDTO source) {
|
|
|
@@ -170,6 +175,14 @@ public class DoctorAppLoginOperator extends AbstractOAuth2PswUserOperator {
|
|
|
String currentUserId = LoginUserStrategy.tr.getCurrentUserId();
|
|
|
SysUserPO sysUser = sysUserRepository.selectById(currentUserId);
|
|
|
OAuth2PswLoginInfoDTO pswLoginInfo = OAuth2Mapper.INSTANCE.toPswLoginInfo(sysUser);
|
|
|
+ String tenantId = LoginUserStrategy.tr.getTenantId();
|
|
|
+ if(StrUtil.isNotEmpty(tenantId)){
|
|
|
+ SysTenantPO tenant = tenantRepository.selectById(tenantId);
|
|
|
+ if(ObjectUtil.isNotNull(tenant)){
|
|
|
+ pswLoginInfo.setTenantId(tenantId);
|
|
|
+ pswLoginInfo.setTenantName(tenant.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
if(ObjectUtil.isNull(sysUser)){
|
|
|
pswLoginInfo.setHavePassword(Boolean.FALSE);
|
|
|
}else {
|