fix: 修复 logs.ts TypeScript 类型错误 — level 参数类型处理
This commit is contained in:
@@ -111,8 +111,9 @@ router.get('/:date', requireAdmin, (req, res) => {
|
||||
let lines = content.split('\n').filter(l => l.trim())
|
||||
|
||||
// 按级别过滤
|
||||
if (level && level !== 'all') {
|
||||
lines = lines.filter(l => l.includes(` ${level.toUpperCase()} `))
|
||||
const levelStr = typeof level === 'string' ? level : ''
|
||||
if (levelStr && levelStr !== 'all') {
|
||||
lines = lines.filter(l => l.includes(` ${levelStr.toUpperCase()} `))
|
||||
}
|
||||
|
||||
// 按关键词过滤
|
||||
|
||||
Reference in New Issue
Block a user