refactor(tenant): 优化租户相关代码

This commit is contained in:
2025-07-15 20:09:54 +08:00
parent ed6dd65a51
commit af1079da6d
111 changed files with 2741 additions and 2319 deletions

View File

@@ -80,7 +80,7 @@ public class UserContext implements Serializable {
*/
private Set<RoleContext> roles;
/*
/**
* 客户端类型
*/
private String clientType;
@@ -134,5 +134,4 @@ public class UserContext implements Serializable {
}
return this.pwdResetTime.plusDays(this.passwordExpirationDays).isBefore(LocalDateTime.now());
}
}

View File

@@ -143,6 +143,15 @@ public class UserContextHolder {
return ExceptionUtils.exToNull(() -> getContext().getId());
}
/**
* 获取租户 ID
*
* @return 租户 ID
*/
public static Long getTenantId() {
return ExceptionUtils.exToNull(() -> getContext().getTenantId());
}
/**
* 获取用户名
*
@@ -180,11 +189,4 @@ public class UserContextHolder {
StpUtil.checkLogin();
return getContext().isAdmin();
}
/**
* 获取租户ID
*/
public static Long getTenantId() {
return ExceptionUtils.exToNull(() -> getContext().getTenantId());
}
}