Compare commits

...

9 Commits

16 changed files with 102 additions and 34 deletions

View File

@ -1,6 +1,6 @@
@echo off
echo.
echo [信息] 清理工程target生成路径。
echo [信息] 清理工程target生成路径。
echo.
%~d0

45
docker/copy.ps1 Normal file
View File

@ -0,0 +1,45 @@
#!/usr/bin/env pwsh
<#
.SYNOPSIS
docker便
#>
# 复制SQL文件
Write-Host "begin copy sql"
Copy-Item -Path "../sql/ry_20250425.sql" -Destination "./mysql/db" -Force
Copy-Item -Path "../sql/ry_config_20250224.sql" -Destination "./mysql/db" -Force
# 复制HTML文件
Write-Host "begin copy html"
if (Test-Path "../ruoyi-ui/dist") {
Remove-Item -Path "./nginx/html/dist" -Recurse -Force -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Path "./nginx/html/dist" -Force | Out-Null
Copy-Item -Path "../ruoyi-ui/dist/*" -Destination "./nginx/html/dist" -Recurse -Force
} else {
Write-Host "Warning: ../ruoyi-ui/dist directory not found"
}
# 复制JAR文件
Write-Host "begin copy ruoyi-gateway"
Copy-Item -Path "../ruoyi-gateway/target/ruoyi-gateway.jar" -Destination "./ruoyi/gateway/jar" -Force
Write-Host "begin copy ruoyi-auth"
Copy-Item -Path "../ruoyi-auth/target/ruoyi-auth.jar" -Destination "./ruoyi/auth/jar" -Force
Write-Host "begin copy ruoyi-visual"
Copy-Item -Path "../ruoyi-visual/ruoyi-monitor/target/ruoyi-visual-monitor.jar" -Destination "./ruoyi/visual/monitor/jar" -Force
Write-Host "begin copy ruoyi-modules-system"
Copy-Item -Path "../ruoyi-modules/ruoyi-system/target/ruoyi-modules-system.jar" -Destination "./ruoyi/modules/system/jar" -Force
Write-Host "begin copy ruoyi-modules-file"
Copy-Item -Path "../ruoyi-modules/ruoyi-file/target/ruoyi-modules-file.jar" -Destination "./ruoyi/modules/file/jar" -Force
Write-Host "begin copy ruoyi-modules-job"
Copy-Item -Path "../ruoyi-modules/ruoyi-job/target/ruoyi-modules-job.jar" -Destination "./ruoyi/modules/job/jar" -Force
Write-Host "begin copy ruoyi-modules-gen"
Copy-Item -Path "../ruoyi-modules/ruoyi-gen/target/ruoyi-modules-gen.jar" -Destination "./ruoyi/modules/gen/jar" -Force
Write-Host "copy completed"

View File

@ -2,7 +2,6 @@ version : '3.8'
services:
ruoyi-nacos:
container_name: ruoyi-nacos
image: nacos/nacos-server
build:
context: ./nacos
environment:
@ -18,7 +17,6 @@ services:
- ruoyi-mysql
ruoyi-mysql:
container_name: ruoyi-mysql
image: mysql:5.7
build:
context: ./mysql
ports:
@ -40,7 +38,6 @@ services:
MYSQL_ROOT_PASSWORD: password
ruoyi-redis:
container_name: ruoyi-redis
image: redis
build:
context: ./redis
ports:

View File

@ -1 +1 @@
存放sql目录下的所有脚本用于docker自动执行。
存放sql目录下的所有脚本用于docker自动执行。

View File

@ -1 +0,0 @@
存放前端ruoyi-ui构建好的静态文件用于nginx请求访问。

View File

@ -1 +1 @@
存放认证中心打包好的jar文件用于docker启动应用。
存放认证中心打包好的jar文件用于docker启动应用。

View File

@ -1 +1 @@
存放网关模块打包好的jar文件用于docker启动应用。
存放网关模块打包好的jar文件用于docker启动应用。

View File

@ -1 +1 @@
存放监控中心打包好的jar文件用于docker启动应用。
存放监控中心打包好的jar文件用于docker启动应用。

View File

@ -35,7 +35,7 @@
<springdoc.version>1.6.9</springdoc.version>
<transmittable-thread-local.version>2.14.4</transmittable-thread-local.version>
<!-- override dependency version -->
<tomcat.version>9.0.108</tomcat.version>
<tomcat.version>9.0.112</tomcat.version>
<logback.version>1.2.13</logback.version>
<spring-framework.version>5.3.39</spring-framework.version>
</properties>

View File

@ -87,6 +87,16 @@ public class Constants
*/
public static final String LOGIN_FAIL = "Error";
/**
*
*/
public static final String ALL_PERMISSION = "*:*:*";
/**
*
*/
public static final String SUPER_ADMIN = "admin";
/**
*
*/

View File

@ -147,12 +147,12 @@ public class ExcelUtil<T>
/**
*
*/
private Map<String, Method> subMethods = new HashMap<>();
private Map<String, Method> subMethods;
/**
*
*/
private Map<String, List<Field>> subFieldsMap = new HashMap<>();
private Map<String, List<Field>> subFieldsMap;
/**
*
@ -225,7 +225,10 @@ public class ExcelUtil<T>
int titleLastCol = this.fields.size() - 1;
if (isSubList())
{
titleLastCol = titleLastCol + subFieldsMap.values().size() - 1;
for (List<Field> currentSubFields : subFieldsMap.values())
{
titleLastCol = titleLastCol + currentSubFields.size() - 1;
}
}
Row titleRow = sheet.createRow(rownum == 0 ? rownum++ : 0);
titleRow.setHeightInPoints(30);
@ -587,7 +590,6 @@ public class ExcelUtil<T>
* excel
*
* @param index
* @param row
*/
@SuppressWarnings("unchecked")
public void fillExcelData(int index)
@ -611,10 +613,10 @@ public class ExcelUtil<T>
try
{
Collection<?> subList = (Collection<?>) getTargetValue(vo, field, excel);
List<Field> currentSubFields = subFieldsMap.get(field.getName());
if (subList != null && !subList.isEmpty())
{
int subIndex = 0;
List<Field> currentSubFields = subFieldsMap.get(field.getName());
for (Object subVo : subList)
{
Row subRow = sheet.getRow(currentRowNum + subIndex);
@ -631,8 +633,8 @@ public class ExcelUtil<T>
}
subIndex++;
}
column += currentSubFields.size();
}
column += currentSubFields.size();
}
catch (Exception e)
{
@ -1349,6 +1351,8 @@ public class ExcelUtil<T>
{
List<Object[]> fields = new ArrayList<Object[]>();
List<Field> tempFields = new ArrayList<>();
subFieldsMap = new HashMap<>();
subMethods = new HashMap<>();
tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields()));
tempFields.addAll(Arrays.asList(clazz.getDeclaredFields()));
if (StringUtils.isNotEmpty(includeFields))

View File

@ -94,7 +94,7 @@ public class DataScopeAspect
List<String> conditions = new ArrayList<String>();
List<String> scopeCustomIds = new ArrayList<String>();
user.getRoles().forEach(role -> {
if (DATA_SCOPE_CUSTOM.equals(role.getDataScope()) && StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission)))
if (DATA_SCOPE_CUSTOM.equals(role.getDataScope()) && StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && (StringUtils.isEmpty(permission) || StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission))))
{
scopeCustomIds.add(Convert.toStr(role.getRoleId()));
}
@ -107,7 +107,7 @@ public class DataScopeAspect
{
continue;
}
if (!StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission)))
if (StringUtils.isNotEmpty(permission) && !StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission)))
{
continue;
}

View File

@ -48,6 +48,9 @@ public class LogAspect
/** 计算操作消耗时间 */
private static final ThreadLocal<Long> TIME_THREADLOCAL = new NamedThreadLocal<Long>("Cost Time");
/** 参数最大长度限制 */
private static final int PARAM_MAX_LENGTH = 2000;
@Autowired
private AsyncLogService asyncLogService;
@ -166,16 +169,16 @@ public class LogAspect
*/
private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog, String[] excludeParamNames) throws Exception
{
Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
String requestMethod = operLog.getRequestMethod();
Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
if (StringUtils.isEmpty(paramsMap) && StringUtils.equalsAny(requestMethod, HttpMethod.PUT.name(), HttpMethod.POST.name(), HttpMethod.DELETE.name()))
{
String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
operLog.setOperParam(StringUtils.substring(params, 0, 2000));
operLog.setOperParam(params);
}
else
{
operLog.setOperParam(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter(excludeParamNames)), 0, 2000));
operLog.setOperParam(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter(excludeParamNames)), 0, PARAM_MAX_LENGTH));
}
}
@ -184,7 +187,7 @@ public class LogAspect
*/
private String argsArrayToString(Object[] paramsArray, String[] excludeParamNames)
{
String params = "";
StringBuilder params = new StringBuilder();
if (paramsArray != null && paramsArray.length > 0)
{
for (Object o : paramsArray)
@ -194,15 +197,20 @@ public class LogAspect
try
{
String jsonObj = JSON.toJSONString(o, excludePropertyPreFilter(excludeParamNames));
params += jsonObj.toString() + " ";
params.append(jsonObj).append(" ");
if (params.length() >= PARAM_MAX_LENGTH)
{
return StringUtils.substring(params.toString(), 0, PARAM_MAX_LENGTH);
}
}
catch (Exception e)
{
log.error("请求参数拼装异常 msg:{}, 参数:{}", e.getMessage(), paramsArray, e);
}
}
}
}
return params.trim();
return params.toString();
}
/**

View File

@ -6,6 +6,7 @@ import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import com.ruoyi.common.core.constant.Constants;
import com.ruoyi.common.core.constant.UserConstants;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.system.api.domain.SysRole;
@ -41,7 +42,7 @@ public class SysPermissionServiceImpl implements ISysPermissionService
// 管理员拥有所有权限
if (user.isAdmin())
{
roles.add("admin");
roles.add(Constants.SUPER_ADMIN);
}
else
{
@ -63,7 +64,7 @@ public class SysPermissionServiceImpl implements ISysPermissionService
// 管理员拥有所有权限
if (user.isAdmin())
{
perms.add("*:*:*");
perms.add(Constants.ALL_PERMISSION);
}
else
{

View File

@ -153,6 +153,7 @@ import DraggableItem from './DraggableItem'
let oldActiveId
let tempActiveData
let clipboard = null
export default {
components: {
@ -211,7 +212,7 @@ export default {
}
},
mounted() {
const clipboard = new ClipboardJS('#copyNode', {
clipboard = new ClipboardJS('#copyNode', {
text: trigger => {
const codeStr = this.generateCode()
this.$notify({
@ -226,6 +227,9 @@ export default {
this.$message.error('代码复制失败')
})
},
beforeDestroy() {
clipboard.destroy()
},
methods: {
activeFormItem(element) {
this.activeData = element