mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 01:25:28 +08:00
Pre Merge pull request !834 from Kayleigh Wang/dev
This commit is contained in:
commit
cb80e15f75
@ -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 ->
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,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)
|
||||||
@ -42,6 +42,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();
|
||||||
|
|||||||
@ -29,7 +29,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()
|
||||||
@ -43,6 +43,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();
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user