权限控制优化
This commit is contained in:
+3
-2
@@ -36,12 +36,13 @@ public class PreAuthorizeAspect
|
|||||||
* 2. 类上的注解
|
* 2. 类上的注解
|
||||||
* 3. 父类或接口上的注解
|
* 3. 父类或接口上的注解
|
||||||
*/
|
*/
|
||||||
public static final String POINTCUT_SIGN = " @annotation(com.tongran.common.security.annotation.RequiresLogin) || "
|
public static final String POINTCUT_SIGN = " (@annotation(com.tongran.common.security.annotation.RequiresLogin) || "
|
||||||
+ "@annotation(com.tongran.common.security.annotation.RequiresPermissions) || "
|
+ "@annotation(com.tongran.common.security.annotation.RequiresPermissions) || "
|
||||||
+ "@annotation(com.tongran.common.security.annotation.RequiresRoles) || "
|
+ "@annotation(com.tongran.common.security.annotation.RequiresRoles) || "
|
||||||
+ "@within(com.tongran.common.security.annotation.RequiresLogin) || "
|
+ "@within(com.tongran.common.security.annotation.RequiresLogin) || "
|
||||||
+ "@within(com.tongran.common.security.annotation.RequiresPermissions) || "
|
+ "@within(com.tongran.common.security.annotation.RequiresPermissions) || "
|
||||||
+ "@within(com.tongran.common.security.annotation.RequiresRoles)";
|
+ "@within(com.tongran.common.security.annotation.RequiresRoles))"
|
||||||
|
+ "&& !@annotation(com.tongran.common.security.annotation.InnerAuth)";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 声明AOP签名
|
* 声明AOP签名
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/machine")
|
@RequestMapping("/machine")
|
||||||
@RequiresPermissions("system:machine")
|
@RequiresPermissions("system:registration")
|
||||||
public class RmRegistrationMachineController extends BaseController
|
public class RmRegistrationMachineController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/switchInterfaceInfo")
|
@RequestMapping("/switchInterfaceInfo")
|
||||||
@RequiresPermissions("system:switchInterfaceInfo")
|
@RequiresPermissions("rocketmq:switchInfo")
|
||||||
public class RmSwitchInterfaceInfoController extends BaseController
|
public class RmSwitchInterfaceInfoController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
+2
-2
@@ -1080,13 +1080,13 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio
|
|||||||
public int addRemark(RmResourceRegistration rmResourceRegistration) {
|
public int addRemark(RmResourceRegistration rmResourceRegistration) {
|
||||||
rmResourceRegistration.setDeployDevice(rmResourceRegistration.getDeployDevice().replace("\n",","));
|
rmResourceRegistration.setDeployDevice(rmResourceRegistration.getDeployDevice().replace("\n",","));
|
||||||
int rows = rmResourceRegistrationMapper.addRemark(rmResourceRegistration);
|
int rows = rmResourceRegistrationMapper.addRemark(rmResourceRegistration);
|
||||||
return rows;
|
return 1;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public int updateRemark(RmResourceRegistration rmResourceRegistration) {
|
public int updateRemark(RmResourceRegistration rmResourceRegistration) {
|
||||||
rmResourceRegistration.setDeployDevice(rmResourceRegistration.getDeployDevice().replace("\n",","));
|
rmResourceRegistration.setDeployDevice(rmResourceRegistration.getDeployDevice().replace("\n",","));
|
||||||
int rows = rmResourceRegistrationMapper.updateRemark(rmResourceRegistration);
|
int rows = rmResourceRegistrationMapper.updateRemark(rmResourceRegistration);
|
||||||
return rows;
|
return 1;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public int addReportedBandwidth(RmResourceRegistration rmResourceRegistration) {
|
public int addReportedBandwidth(RmResourceRegistration rmResourceRegistration) {
|
||||||
|
|||||||
@@ -56,6 +56,26 @@
|
|||||||
<onMismatch>DENY</onMismatch>
|
<onMismatch>DENY</onMismatch>
|
||||||
</filter>
|
</filter>
|
||||||
</appender>
|
</appender>
|
||||||
|
<!-- 简化版debug.log配置,只包含日志框架的输出 -->
|
||||||
|
<appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/debug.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/debug.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<!-- 记录DEBUG及以上级别,但不记录ERROR(ERROR有单独文件) -->
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>ERROR</level>
|
||||||
|
<onMatch>DENY</onMatch>
|
||||||
|
<onMismatch>NEUTRAL</onMismatch>
|
||||||
|
</filter>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<level>DEBUG</level>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
<!-- 系统模块日志级别控制 -->
|
<!-- 系统模块日志级别控制 -->
|
||||||
<logger name="com.tongran" level="info" />
|
<logger name="com.tongran" level="info" />
|
||||||
|
|||||||
+7
-5
@@ -121,12 +121,14 @@ public class RmResourceRemoteServiceImpl implements IRmResourceRemoteService
|
|||||||
for (RmResourceRemote resourceRemote : reslutList) {
|
for (RmResourceRemote resourceRemote : reslutList) {
|
||||||
// 脚本执行返回结果
|
// 脚本执行返回结果
|
||||||
JSONObject jsonObject = JSONObject.parseObject(resourceRemote.getDescription());
|
JSONObject jsonObject = JSONObject.parseObject(resourceRemote.getDescription());
|
||||||
String command = jsonObject.getString("command");
|
|
||||||
String resOut = jsonObject.getString("resOut");
|
|
||||||
String sucOrFail = (!"".equals(resOut) && !"脚本执行失败".equals(resOut)) ? "\n执行成功,\n":"\n执行失败,\n";
|
|
||||||
StringBuilder resultSb = new StringBuilder();
|
StringBuilder resultSb = new StringBuilder();
|
||||||
resultSb.append("【").append(resourceRemote.getClientId()).append("】脚本执行命令:\n")
|
if(jsonObject != null){
|
||||||
.append(command).append(sucOrFail).append("执行结果如下:\n").append(resOut);
|
String command = jsonObject.getString("command");
|
||||||
|
String resOut = jsonObject.getString("resOut");
|
||||||
|
String sucOrFail = (!"".equals(resOut) && !"脚本执行失败".equals(resOut)) ? "\n执行成功,\n":"\n执行失败,\n";
|
||||||
|
resultSb.append("【").append(resourceRemote.getClientId()).append("】脚本执行命令:\n")
|
||||||
|
.append(command).append(sucOrFail).append("执行结果如下:\n").append(resOut);
|
||||||
|
}
|
||||||
Map<String,Object> map = new HashMap<>();
|
Map<String,Object> map = new HashMap<>();
|
||||||
Date createTime = resourceRemote.getCreateTime();
|
Date createTime = resourceRemote.getCreateTime();
|
||||||
String createTimeStr = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", createTime);
|
String createTimeStr = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", createTime);
|
||||||
|
|||||||
@@ -57,6 +57,26 @@
|
|||||||
<onMismatch>DENY</onMismatch>
|
<onMismatch>DENY</onMismatch>
|
||||||
</filter>
|
</filter>
|
||||||
</appender>
|
</appender>
|
||||||
|
<!-- 简化版debug.log配置,只包含日志框架的输出 -->
|
||||||
|
<appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/debug.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/debug.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<maxHistory>30</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<!-- 记录DEBUG及以上级别,但不记录ERROR(ERROR有单独文件) -->
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>ERROR</level>
|
||||||
|
<onMatch>DENY</onMatch>
|
||||||
|
<onMismatch>NEUTRAL</onMismatch>
|
||||||
|
</filter>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<level>DEBUG</level>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
|
||||||
<!-- RocketMQ模块日志级别控制 -->
|
<!-- RocketMQ模块日志级别控制 -->
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
|
||||||
<if test="resultFlag != null "> and result_flag = #{resultFlag}</if>
|
<if test="resultFlag != null "> and result_flag = #{resultFlag}</if>
|
||||||
<if test="scriptId != null "> and script_id = #{scriptId}</if>
|
<if test="scriptId != null "> and script_id = #{scriptId}</if>
|
||||||
|
and script_id != ''
|
||||||
</where>
|
</where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="clientId != null and clientId != ''">
|
<when test="clientId != null and clientId != ''">
|
||||||
|
|||||||
Reference in New Issue
Block a user