Pre Merge pull request !833 from Kayleigh Wang/dev

This commit is contained in:
Kayleigh Wang 2026-03-01 06:09:38 +00:00 committed by Gitee
commit 4c970fd06f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
9 changed files with 14 additions and 11 deletions

View File

@ -229,9 +229,9 @@ public class AuthController {
String referer = request.getHeader("referer"); String referer = request.getHeader("referer");
if (StringUtils.isNotBlank(referer)) { if (StringUtils.isNotBlank(referer)) {
// 这里从referer中取值是为了本地使用hosts添加虚拟域名方便本地环境调试 // 这里从referer中取值是为了本地使用hosts添加虚拟域名方便本地环境调试
host = referer.split("//")[1].split("/")[0]; host = new java.net.URI(referer).getHost();
} else { } else {
host = new URL(request.getRequestURL().toString()).getHost(); host = new java.net.URI(request.getRequestURL().toString()).getHost();
} }
// 根据域名进行筛选 // 根据域名进行筛选
List<TenantListVo> list = StreamUtils.filter(voList, vo -> List<TenantListVo> list = StreamUtils.filter(voList, vo ->

View File

@ -23,7 +23,7 @@ import java.util.function.Supplier;
* @version 3.5.0 * @version 3.5.0
*/ */
@NoArgsConstructor(access = AccessLevel.PRIVATE) @NoArgsConstructor(access = AccessLevel.PRIVATE)
@SuppressWarnings("unchecked cast") @SuppressWarnings("unchecked")
public class DataPermissionHelper { public class DataPermissionHelper {
private static final String DATA_PERMISSION_KEY = "data:permission"; private static final String DATA_PERMISSION_KEY = "data:permission";

View File

@ -113,7 +113,7 @@ public class PlusSaTokenDao implements SaTokenDaoBySessionFollowObject {
* @param key 键名称 * @param key 键名称
* @return object * @return object
*/ */
@SuppressWarnings("unchecked cast") @SuppressWarnings("unchecked")
@Override @Override
public <T> T getObject(String key, Class<T> classType) { public <T> T getObject(String key, Class<T> classType) {
Object o = CAFFEINE.get(key, k -> RedisUtils.getCacheObject(key)); Object o = CAFFEINE.get(key, k -> RedisUtils.getCacheObject(key));

View File

@ -63,7 +63,7 @@ public class LoginHelper {
/** /**
* 获取用户(多级缓存) * 获取用户(多级缓存)
*/ */
@SuppressWarnings("unchecked cast") @SuppressWarnings("unchecked")
public static <T extends LoginUser> T getLoginUser() { public static <T extends LoginUser> T getLoginUser() {
SaSession session = StpUtil.getTokenSession(); SaSession session = StpUtil.getTokenSession();
if (ObjectUtil.isNull(session)) { if (ObjectUtil.isNull(session)) {
@ -75,7 +75,7 @@ public class LoginHelper {
/** /**
* 获取用户基于token * 获取用户基于token
*/ */
@SuppressWarnings("unchecked cast") @SuppressWarnings("unchecked")
public static <T extends LoginUser> T getLoginUser(String token) { public static <T extends LoginUser> T getLoginUser(String token) {
SaSession session = StpUtil.getTokenSessionByToken(token); SaSession session = StpUtil.getTokenSessionByToken(token);
if (ObjectUtil.isNull(session)) { if (ObjectUtil.isNull(session)) {

View File

@ -19,7 +19,8 @@ public class I18nLocaleResolver implements LocaleResolver {
Locale locale = Locale.getDefault(); Locale locale = Locale.getDefault();
if (language != null && language.length() > 0) { if (language != null && language.length() > 0) {
String[] split = language.split("_"); String[] split = language.split("_");
locale = new Locale(split[0], split[1]); String languageTag = String.join("-", split);
locale = Locale.forLanguageTag(languageTag);
} }
return locale; return locale;
} }

View File

@ -26,7 +26,7 @@ import java.util.stream.IntStream;
public class TestMapJobAnnotation { public class TestMapJobAnnotation {
@MapExecutor @MapExecutor
public ExecuteResult doJobMapExecute(MapArgs mapArgs, MapHandler mapHandler) { public ExecuteResult doJobMapExecute(MapArgs mapArgs, MapHandler<List<Integer>> mapHandler) {
// 生成1~200数值并分片 // 生成1~200数值并分片
int partitionSize = 50; int partitionSize = 50;
List<List<Integer>> partition = IntStream.rangeClosed(1, 200) List<List<Integer>> partition = IntStream.rangeClosed(1, 200)
@ -41,6 +41,7 @@ public class TestMapJobAnnotation {
@MapExecutor(taskName = "doCalc") @MapExecutor(taskName = "doCalc")
public ExecuteResult doCalc(MapArgs mapArgs) { public ExecuteResult doCalc(MapArgs mapArgs) {
@SuppressWarnings("unchecked")
List<Integer> sourceList = (List<Integer>) mapArgs.getMapResult(); List<Integer> sourceList = (List<Integer>) mapArgs.getMapResult();
// 遍历sourceList的每一个元素,计算出一个累加值partitionTotal // 遍历sourceList的每一个元素,计算出一个累加值partitionTotal
int partitionTotal = sourceList.stream().mapToInt(i -> i).sum(); int partitionTotal = sourceList.stream().mapToInt(i -> i).sum();

View File

@ -28,7 +28,7 @@ import java.util.stream.IntStream;
public class TestMapReduceAnnotation1 { public class TestMapReduceAnnotation1 {
@MapExecutor @MapExecutor
public ExecuteResult rootMapExecute(MapArgs mapArgs, MapHandler mapHandler) { public ExecuteResult rootMapExecute(MapArgs mapArgs, MapHandler<List<Integer>> mapHandler) {
int partitionSize = 50; int partitionSize = 50;
List<List<Integer>> partition = IntStream.rangeClosed(1, 200) List<List<Integer>> partition = IntStream.rangeClosed(1, 200)
.boxed() .boxed()
@ -42,6 +42,7 @@ public class TestMapReduceAnnotation1 {
@MapExecutor(taskName = "doCalc") @MapExecutor(taskName = "doCalc")
public ExecuteResult doCalc(MapArgs mapArgs) { public ExecuteResult doCalc(MapArgs mapArgs) {
@SuppressWarnings("unchecked")
List<Integer> sourceList = (List<Integer>) mapArgs.getMapResult(); List<Integer> sourceList = (List<Integer>) mapArgs.getMapResult();
// 遍历sourceList的每一个元素,计算出一个累加值partitionTotal // 遍历sourceList的每一个元素,计算出一个累加值partitionTotal
int partitionTotal = sourceList.stream().mapToInt(i -> i).sum(); int partitionTotal = sourceList.stream().mapToInt(i -> i).sum();

View File

@ -394,7 +394,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
log.warn("[根目录路由冲突] 根目录下路由 '{}' 必须唯一,已被菜单 '{}' 占用", path, sysMenu.getMenuName()); log.warn("[根目录路由冲突] 根目录下路由 '{}' 必须唯一,已被菜单 '{}' 占用", path, sysMenu.getMenuName());
return false; return false;
} else if (StringUtils.equalsAnyIgnoreCase(routeName, dbRouteName) } else if (StringUtils.equalsAnyIgnoreCase(routeName, dbRouteName)
&& sysMenu.getMenuType().equals(menu.getMenuType())) { && sysMenu.getMenuType().equals(menu.getMenuType()) && parentId.equals(dbParentId)) {
log.warn("[路由名称冲突] 路由名称 '{}' 需全局唯一,已被菜单 '{}' 使用", routeName, sysMenu.getMenuName()); log.warn("[路由名称冲突] 路由名称 '{}' 需全局唯一,已被菜单 '{}' 使用", routeName, sysMenu.getMenuName());
return false; return false;
} }

View File

@ -102,7 +102,7 @@ public class FlwNodeExtServiceImpl implements NodeExtService, IFlwNodeExtService
* @param sources 数据来源枚举类或字典类型 * @param sources 数据来源枚举类或字典类型
* @return 构建的 `NodeExt` 对象 * @return 构建的 `NodeExt` 对象
*/ */
@SuppressWarnings("unchecked cast") @SuppressWarnings("unchecked")
private NodeExt buildNodeExt(String code, String name, int type, List<Object> sources) { private NodeExt buildNodeExt(String code, String name, int type, List<Object> sources) {
NodeExt nodeExt = new NodeExt(); NodeExt nodeExt = new NodeExt();
nodeExt.setCode(code); nodeExt.setCode(code);