fix: 修复ipWhiteList脏数据问题

This commit is contained in:
chaoszhu
2026-06-27 14:49:48 +08:00
parent 7a5cc5492e
commit fd3e9bd965
+2 -2
View File
@@ -4,8 +4,8 @@ const sessionDB = new SessionDB().getInstance()
async function getLog({ res }) {
let sessionList = await sessionDB.findAsync({})
let { ipWhiteList } = await keyDB.findOneAsync({})
ipWhiteList = ipWhiteList.filter(ip => Boolean(ip))
let { ipWhiteList = [] } = await keyDB.findOneAsync({}) || {}
ipWhiteList = ipWhiteList.filter(ip => typeof ip === 'string' && ip.trim() !== '')
sessionList = sessionList.map(item => {
// eslint-disable-next-line no-unused-vars
const { session, ...otherInfo } = item