| | |
| | | import org.dromara.common.core.constant.Constants; |
| | | import org.dromara.common.core.constant.GlobalConstants; |
| | | import org.dromara.common.core.constant.TenantConstants; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.core.domain.dto.RoleDTO; |
| | | import org.dromara.common.core.domain.model.LoginUser; |
| | | import org.dromara.common.core.enums.LoginType; |
| | |
| | | import org.dromara.system.service.ISysPermissionService; |
| | | import org.dromara.system.service.ISysSocialService; |
| | | import org.dromara.system.service.ISysTenantService; |
| | | import org.dromara.web.domain.vo.LoginVo; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | * @param authUserData 授权响应实体 |
| | | * @return 统一响应实体 |
| | | */ |
| | | public R<LoginVo> sociaRegister(AuthUser authUserData) { |
| | | public void socialRegister(AuthUser authUserData) { |
| | | SysSocialBo bo = new SysSocialBo(); |
| | | bo.setUserId(LoginHelper.getUserId()); |
| | | bo.setAuthId(authUserData.getSource() + authUserData.getUuid()); |
| | |
| | | BeanUtils.copyProperties(authUserData, bo); |
| | | BeanUtils.copyProperties(authUserData.getToken(), bo); |
| | | sysSocialService.insertByBo(bo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | |
| | | // 超级管理员 登出清除动态租户 |
| | | TenantHelper.clearDynamic(); |
| | | } |
| | | StpUtil.logout(); |
| | | recordLogininfor(loginUser.getTenantId(), loginUser.getUsername(), Constants.LOGOUT, MessageUtils.message("user.logout.success")); |
| | | } catch (NotLoginException ignored) { |
| | | } finally { |
| | | try { |
| | | StpUtil.logout(); |
| | | } catch (NotLoginException ignored) { |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | log.info("登录租户:{} 已被停用.", tenantId); |
| | | throw new TenantException("tenant.blocked"); |
| | | } else if (ObjectUtil.isNotNull(tenant.getExpireTime()) |
| | | && new Date().after(tenant.getExpireTime())) { |
| | | && new Date().after(tenant.getExpireTime())) { |
| | | log.info("登录租户:{} 已超过有效期.", tenantId); |
| | | throw new TenantException("tenant.expired"); |
| | | } |