20260104:

1、临时修改
This commit is contained in:
George 2026-01-04 21:01:43 +08:00
parent d4403f5d42
commit f33ecdedbf
10 changed files with 40 additions and 30 deletions

View File

@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/monitor/server")
public class ServerController {
@ApiOperation("获取服务器信息")
@PreAuthorize("@ss.hasPermi('monitor:server:list')")
@PreAuthorize("@ss.hasAnyPermi('monitor:server:list,iot:device:list')")
@GetMapping()
public AjaxResult getInfo() throws Exception {
Server server = new Server();

View File

@ -79,7 +79,7 @@ public class SysLogininforController extends BaseController {
}
@ApiOperation("获取一周内每天用户统计")
@PreAuthorize("@ss.hasPermi('monitor:logininfor:list')")
@PreAuthorize("@ss.hasAnyPermi('monitor:logininfor:list,iot:device:list')")
@GetMapping("/userCount")
public AjaxResult userCount() {
return toAjax(logininforService.getUserCount());

View File

@ -245,7 +245,7 @@ public class SysUserController extends BaseController {
* 获取部门树列表
*/
@ApiOperation("获取部门树列表")
@PreAuthorize("@ss.hasPermi('system:user:list')")
@PreAuthorize("@ss.hasAnyPermi('system:user:list,iot:device:list')")
@GetMapping("/deptTree")
public AjaxResult deptTree(SysDept dept) {
return success(deptService.selectDeptTreeList(dept));

View File

@ -141,7 +141,7 @@ sip:
# 日志配置
logging:
level:
com.fastbee: info
com.fastbee: debug
com.yomahub: warn
org.dromara: warn
org.springframework: warn

View File

@ -13,73 +13,75 @@
</appender>
<!-- 系统日志输出 -->
<!-- 原有的分级日志appender(已注释,统一使用file_all记录) -->
<!--
<appender name="file_debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-debug.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-debug.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 10天 -->
<maxHistory>10</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 DEBUG-->
<level>DEBUG</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 10天 -->
<maxHistory>10</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 10天 -->
<maxHistory>10</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
-->
<!-- 统一系统日志输出(包含所有级别:DEBUG、INFO、ERROR)用于溯源 -->
<appender name="file_all" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-all.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-all.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 10天 -->
<maxHistory>10</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<!-- 使用ThresholdFilter从DEBUG级别开始记录,包含所有级别 -->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>DEBUG</level>
</filter>
</appender>
<!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
@ -138,11 +140,19 @@
</root>
<!--系统操作日志-->
<!-- 暂时统一记录到一个文件,方便溯源 -->
<root level="info">
<appender-ref ref="file_all"/>
</root>
<!-- 原有的分级日志配置(已注释,需要分开记录时取消注释) -->
<!--
<root level="info">
<appender-ref ref="file_debug"/>
<appender-ref ref="file_info"/>
<appender-ref ref="file_error"/>
</root>
-->
<!--系统用户操作日志-->
<logger name="sys-user" level="info">

View File

@ -468,8 +468,8 @@ public class DeviceController extends BaseController {
try {
Long userId = getUserId();
String cacheKey = CacheConstants.DEVICE_DEBUG_USER_KEY + userId;
// 设置标志,过期时间30分钟(防止页面异常关闭导致标志未清除)
redisCache.setCacheObject(cacheKey, "1", 30, TimeUnit.MINUTES);
// 设置标志,过期时间7天(防止页面异常关闭导致标志未清除)
redisCache.setCacheObject(cacheKey, "1", 7, TimeUnit.DAYS);
return AjaxResult.success("已开启调试日志记录");
} catch (Exception e) {
return AjaxResult.error("开启调试日志记录失败:" + e.getMessage());

View File

@ -34,7 +34,7 @@ public class GroupController extends BaseController {
/**
* 查询设备分组列表
*/
@PreAuthorize("@ss.hasPermi('iot:group:list')")
@PreAuthorize("@ss.hasAnyPermi('iot:group:list,iot:device:list')")
@GetMapping("/list")
@ApiOperation("分组分页列表")
public TableDataInfo list(Group group) {

View File

@ -136,7 +136,7 @@ public class ThingsModelController extends BaseController {
/**
* 获取缓存的JSON物模型
*/
@PreAuthorize("@ss.hasPermi('iot:model:query')")
@PreAuthorize("@ss.hasAnyPermi('iot:model:query,iot:device:list')")
@GetMapping(value = "/cache/{productId}")
@ApiOperation("获取缓存的JSON物模型")
public AjaxResult getCacheThingsModelByProductId(@PathVariable("productId") Long productId) {

View File

@ -34,7 +34,7 @@ public class AlertLogController extends BaseController {
* 查询设备告警列表
*/
@ApiOperation("查询设备告警列表")
@PreAuthorize("@ss.hasPermi('iot:alertLog:list')")
@PreAuthorize("@ss.hasAnyPermi('iot:alertLog:list,iot:device:list')")
@GetMapping("/list")
public TableDataInfo list(AlertLog alertLog) {
startPage();

View File

@ -33,7 +33,7 @@ public class SceneModelController extends BaseController {
/**
* 查询场景管理列表
*/
@PreAuthorize("@ss.hasPermi('scene:model:list')")
@PreAuthorize("@ss.hasAnyPermi('scene:model:list,iot:device:list')")
@GetMapping("/list")
@ApiOperation("查询场景管理列表")
public TableDataInfo list(SceneModel sceneModel) {