Compare commits
7 Commits
52769bb34e
...
3eb17b4810
| Author | SHA1 | Date |
|---|---|---|
|
|
3eb17b4810 | |
|
|
f53b783049 | |
|
|
97f30a5415 | |
|
|
ad1d009165 | |
|
|
90cbabb7a7 | |
|
|
1c4dbb1e46 | |
|
|
eeeaa00747 |
|
|
@ -7,10 +7,16 @@ services:
|
||||||
context: ./nacos
|
context: ./nacos
|
||||||
environment:
|
environment:
|
||||||
- MODE=standalone
|
- MODE=standalone
|
||||||
|
# Nacos 2.2+ 需要设置以下启动参数
|
||||||
|
- NACOS_AUTH_TOKEN=U2VjcmV0S2V5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5
|
||||||
|
- NACOS_AUTH_IDENTITY_KEY=serverIdentity
|
||||||
|
- NACOS_AUTH_IDENTITY_VALUE=security
|
||||||
volumes:
|
volumes:
|
||||||
- ./nacos/logs/:/home/nacos/logs
|
- ./nacos/logs/:/home/nacos/logs
|
||||||
- ./nacos/conf/application.properties:/home/nacos/conf/application.properties
|
- ./nacos/conf/application.properties:/home/nacos/conf/application.properties
|
||||||
ports:
|
ports:
|
||||||
|
# Nacos 2.0+ 默认管理端口
|
||||||
|
- "8864:8080"
|
||||||
- "8848:8848"
|
- "8848:8848"
|
||||||
- "9848:9848"
|
- "9848:9848"
|
||||||
- "9849:9849"
|
- "9849:9849"
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@ nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/
|
||||||
|
|
||||||
nacos.core.auth.system.type=nacos
|
nacos.core.auth.system.type=nacos
|
||||||
nacos.core.auth.enabled=false
|
nacos.core.auth.enabled=false
|
||||||
nacos.core.auth.default.token.expire.seconds=18000
|
nacos.core.auth.plugin.nacos.token.expire.seconds=18000
|
||||||
nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
|
nacos.core.auth.plugin.nacos.token.secret.key=U2VjcmV0S2V5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5
|
||||||
nacos.core.auth.caching.enabled=true
|
nacos.core.auth.caching.enabled=true
|
||||||
nacos.core.auth.enable.userAgentAuthWhite=false
|
nacos.core.auth.enable.userAgentAuthWhite=false
|
||||||
nacos.core.auth.server.identity.key=serverIdentity
|
nacos.core.auth.server.identity.key=serverIdentity
|
||||||
|
|
|
||||||
2
pom.xml
2
pom.xml
|
|
@ -35,7 +35,7 @@
|
||||||
<springdoc.version>1.6.9</springdoc.version>
|
<springdoc.version>1.6.9</springdoc.version>
|
||||||
<transmittable-thread-local.version>2.14.4</transmittable-thread-local.version>
|
<transmittable-thread-local.version>2.14.4</transmittable-thread-local.version>
|
||||||
<!-- override dependency 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>
|
<logback.version>1.2.13</logback.version>
|
||||||
<spring-framework.version>5.3.39</spring-framework.version>
|
<spring-framework.version>5.3.39</spring-framework.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,16 @@ public class Constants
|
||||||
*/
|
*/
|
||||||
public static final String LOGIN_FAIL = "Error";
|
public static final String LOGIN_FAIL = "Error";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有权限标识
|
||||||
|
*/
|
||||||
|
public static final String ALL_PERMISSION = "*:*:*";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理员角色权限标识
|
||||||
|
*/
|
||||||
|
public static final String SUPER_ADMIN = "admin";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前记录起始索引
|
* 当前记录起始索引
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -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;
|
int titleLastCol = this.fields.size() - 1;
|
||||||
if (isSubList())
|
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);
|
Row titleRow = sheet.createRow(rownum == 0 ? rownum++ : 0);
|
||||||
titleRow.setHeightInPoints(30);
|
titleRow.setHeightInPoints(30);
|
||||||
|
|
@ -587,7 +590,6 @@ public class ExcelUtil<T>
|
||||||
* 填充excel数据
|
* 填充excel数据
|
||||||
*
|
*
|
||||||
* @param index 序号
|
* @param index 序号
|
||||||
* @param row 单元格行
|
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void fillExcelData(int index)
|
public void fillExcelData(int index)
|
||||||
|
|
@ -611,10 +613,10 @@ public class ExcelUtil<T>
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Collection<?> subList = (Collection<?>) getTargetValue(vo, field, excel);
|
Collection<?> subList = (Collection<?>) getTargetValue(vo, field, excel);
|
||||||
|
List<Field> currentSubFields = subFieldsMap.get(field.getName());
|
||||||
if (subList != null && !subList.isEmpty())
|
if (subList != null && !subList.isEmpty())
|
||||||
{
|
{
|
||||||
int subIndex = 0;
|
int subIndex = 0;
|
||||||
List<Field> currentSubFields = subFieldsMap.get(field.getName());
|
|
||||||
for (Object subVo : subList)
|
for (Object subVo : subList)
|
||||||
{
|
{
|
||||||
Row subRow = sheet.getRow(currentRowNum + subIndex);
|
Row subRow = sheet.getRow(currentRowNum + subIndex);
|
||||||
|
|
@ -631,8 +633,8 @@ public class ExcelUtil<T>
|
||||||
}
|
}
|
||||||
subIndex++;
|
subIndex++;
|
||||||
}
|
}
|
||||||
column += currentSubFields.size();
|
|
||||||
}
|
}
|
||||||
|
column += currentSubFields.size();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
@ -1349,6 +1351,8 @@ public class ExcelUtil<T>
|
||||||
{
|
{
|
||||||
List<Object[]> fields = new ArrayList<Object[]>();
|
List<Object[]> fields = new ArrayList<Object[]>();
|
||||||
List<Field> tempFields = new ArrayList<>();
|
List<Field> tempFields = new ArrayList<>();
|
||||||
|
subFieldsMap = new HashMap<>();
|
||||||
|
subMethods = new HashMap<>();
|
||||||
tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields()));
|
tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields()));
|
||||||
tempFields.addAll(Arrays.asList(clazz.getDeclaredFields()));
|
tempFields.addAll(Arrays.asList(clazz.getDeclaredFields()));
|
||||||
if (StringUtils.isNotEmpty(includeFields))
|
if (StringUtils.isNotEmpty(includeFields))
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ public class DataScopeAspect
|
||||||
List<String> conditions = new ArrayList<String>();
|
List<String> conditions = new ArrayList<String>();
|
||||||
List<String> scopeCustomIds = new ArrayList<String>();
|
List<String> scopeCustomIds = new ArrayList<String>();
|
||||||
user.getRoles().forEach(role -> {
|
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()));
|
scopeCustomIds.add(Convert.toStr(role.getRoleId()));
|
||||||
}
|
}
|
||||||
|
|
@ -107,7 +107,7 @@ public class DataScopeAspect
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission)))
|
if (StringUtils.isNotEmpty(permission) && !StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission)))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,9 @@ public class LogAspect
|
||||||
/** 计算操作消耗时间 */
|
/** 计算操作消耗时间 */
|
||||||
private static final ThreadLocal<Long> TIME_THREADLOCAL = new NamedThreadLocal<Long>("Cost Time");
|
private static final ThreadLocal<Long> TIME_THREADLOCAL = new NamedThreadLocal<Long>("Cost Time");
|
||||||
|
|
||||||
|
/** 参数最大长度限制 */
|
||||||
|
private static final int PARAM_MAX_LENGTH = 2000;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AsyncLogService asyncLogService;
|
private AsyncLogService asyncLogService;
|
||||||
|
|
||||||
|
|
@ -166,16 +169,16 @@ public class LogAspect
|
||||||
*/
|
*/
|
||||||
private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog, String[] excludeParamNames) throws Exception
|
private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog, String[] excludeParamNames) throws Exception
|
||||||
{
|
{
|
||||||
Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
|
|
||||||
String requestMethod = operLog.getRequestMethod();
|
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()))
|
if (StringUtils.isEmpty(paramsMap) && StringUtils.equalsAny(requestMethod, HttpMethod.PUT.name(), HttpMethod.POST.name(), HttpMethod.DELETE.name()))
|
||||||
{
|
{
|
||||||
String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
|
String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
|
||||||
operLog.setOperParam(StringUtils.substring(params, 0, 2000));
|
operLog.setOperParam(params);
|
||||||
}
|
}
|
||||||
else
|
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)
|
private String argsArrayToString(Object[] paramsArray, String[] excludeParamNames)
|
||||||
{
|
{
|
||||||
String params = "";
|
StringBuilder params = new StringBuilder();
|
||||||
if (paramsArray != null && paramsArray.length > 0)
|
if (paramsArray != null && paramsArray.length > 0)
|
||||||
{
|
{
|
||||||
for (Object o : paramsArray)
|
for (Object o : paramsArray)
|
||||||
|
|
@ -194,15 +197,20 @@ public class LogAspect
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String jsonObj = JSON.toJSONString(o, excludePropertyPreFilter(excludeParamNames));
|
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)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
log.error("请求参数拼装异常 msg:{}, 参数:{}", e.getMessage(), paramsArray, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return params.trim();
|
return params.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import java.util.Set;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import com.ruoyi.common.core.constant.Constants;
|
||||||
import com.ruoyi.common.core.constant.UserConstants;
|
import com.ruoyi.common.core.constant.UserConstants;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.system.api.domain.SysRole;
|
import com.ruoyi.system.api.domain.SysRole;
|
||||||
|
|
@ -41,7 +42,7 @@ public class SysPermissionServiceImpl implements ISysPermissionService
|
||||||
// 管理员拥有所有权限
|
// 管理员拥有所有权限
|
||||||
if (user.isAdmin())
|
if (user.isAdmin())
|
||||||
{
|
{
|
||||||
roles.add("admin");
|
roles.add(Constants.SUPER_ADMIN);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -63,7 +64,7 @@ public class SysPermissionServiceImpl implements ISysPermissionService
|
||||||
// 管理员拥有所有权限
|
// 管理员拥有所有权限
|
||||||
if (user.isAdmin())
|
if (user.isAdmin())
|
||||||
{
|
{
|
||||||
perms.add("*:*:*");
|
perms.add(Constants.ALL_PERMISSION);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,7 @@ import DraggableItem from './DraggableItem'
|
||||||
|
|
||||||
let oldActiveId
|
let oldActiveId
|
||||||
let tempActiveData
|
let tempActiveData
|
||||||
|
let clipboard = null
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -211,7 +212,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
const clipboard = new ClipboardJS('#copyNode', {
|
clipboard = new ClipboardJS('#copyNode', {
|
||||||
text: trigger => {
|
text: trigger => {
|
||||||
const codeStr = this.generateCode()
|
const codeStr = this.generateCode()
|
||||||
this.$notify({
|
this.$notify({
|
||||||
|
|
@ -226,6 +227,9 @@ export default {
|
||||||
this.$message.error('代码复制失败')
|
this.$message.error('代码复制失败')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
clipboard.destroy()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
activeFormItem(element) {
|
activeFormItem(element) {
|
||||||
this.activeData = element
|
this.activeData = element
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ insert into sys_menu values('108', '日志管理', '1', '9', 'log',
|
||||||
insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', '', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 'admin', sysdate(), '', null, '在线用户菜单');
|
insert into sys_menu values('109', '在线用户', '2', '1', 'online', 'monitor/online/index', '', '', 1, 0, 'C', '0', '0', 'monitor:online:list', 'online', 'admin', sysdate(), '', null, '在线用户菜单');
|
||||||
insert into sys_menu values('110', '定时任务', '2', '2', 'job', 'monitor/job/index', '', '', 1, 0, 'C', '0', '0', 'monitor:job:list', 'job', 'admin', sysdate(), '', null, '定时任务菜单');
|
insert into sys_menu values('110', '定时任务', '2', '2', 'job', 'monitor/job/index', '', '', 1, 0, 'C', '0', '0', 'monitor:job:list', 'job', 'admin', sysdate(), '', null, '定时任务菜单');
|
||||||
insert into sys_menu values('111', 'Sentinel控制台', '2', '3', 'http://localhost:8718', '', '', '', 0, 0, 'C', '0', '0', 'monitor:sentinel:list', 'sentinel', 'admin', sysdate(), '', null, '流量控制菜单');
|
insert into sys_menu values('111', 'Sentinel控制台', '2', '3', 'http://localhost:8718', '', '', '', 0, 0, 'C', '0', '0', 'monitor:sentinel:list', 'sentinel', 'admin', sysdate(), '', null, '流量控制菜单');
|
||||||
insert into sys_menu values('112', 'Nacos控制台', '2', '4', 'http://localhost:8848/nacos', '', '', '', 0, 0, 'C', '0', '0', 'monitor:nacos:list', 'nacos', 'admin', sysdate(), '', null, '服务治理菜单');
|
insert into sys_menu values('112', 'Nacos控制台', '2', '4', 'http://localhost:8864', '', '', '', 0, 0, 'C', '0', '0', 'monitor:nacos:list', 'nacos', 'admin', sysdate(), '', null, '服务治理菜单');
|
||||||
insert into sys_menu values('113', 'Admin控制台', '2', '5', 'http://localhost:9100/login', '', '', '', 0, 0, 'C', '0', '0', 'monitor:server:list', 'server', 'admin', sysdate(), '', null, '服务监控菜单');
|
insert into sys_menu values('113', 'Admin控制台', '2', '5', 'http://localhost:9100/login', '', '', '', 0, 0, 'C', '0', '0', 'monitor:server:list', 'server', 'admin', sysdate(), '', null, '服务监控菜单');
|
||||||
insert into sys_menu values('114', '表单构建', '3', '1', 'build', 'tool/build/index', '', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', sysdate(), '', null, '表单构建菜单');
|
insert into sys_menu values('114', '表单构建', '3', '1', 'build', 'tool/build/index', '', '', 1, 0, 'C', '0', '0', 'tool:build:list', 'build', 'admin', sysdate(), '', null, '表单构建菜单');
|
||||||
insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', sysdate(), '', null, '代码生成菜单');
|
insert into sys_menu values('115', '代码生成', '3', '2', 'gen', 'tool/gen/index', '', '', 1, 0, 'C', '0', '0', 'tool:gen:list', 'code', 'admin', sysdate(), '', null, '代码生成菜单');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue