🐛 修复删除实例异常
This commit is contained in:
parent
fe5e75878a
commit
c8898e6acb
@ -111,7 +111,7 @@ async function updateHost({ res, request }) {
|
|||||||
// console.log(`${ authType }__commonKey加密存储: `, record[authType])
|
// console.log(`${ authType }__commonKey加密存储: `, record[authType])
|
||||||
}
|
}
|
||||||
hostList.splice(idx, 1, record)
|
hostList.splice(idx, 1, record)
|
||||||
writeHostList(hostList)
|
await writeHostList(hostList)
|
||||||
res.success()
|
res.success()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,8 +121,8 @@ async function removeHost({
|
|||||||
let { body: { ids } } = request
|
let { body: { ids } } = request
|
||||||
let hostList = await readHostList()
|
let hostList = await readHostList()
|
||||||
if (!Array.isArray(ids)) return res.fail({ msg: '参数错误' })
|
if (!Array.isArray(ids)) return res.fail({ msg: '参数错误' })
|
||||||
hostList = hostList.filter(({ id }) => !ids.includes(id))
|
hostList = hostList.filter(({ _id }) => !ids.includes(_id))
|
||||||
writeHostList(hostList)
|
await writeHostList(hostList)
|
||||||
res.success({ data: '已移除' })
|
res.success({ data: '已移除' })
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ async function importHost({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
hostList.push(...newHostList)
|
hostList.push(...newHostList)
|
||||||
writeHostList(hostList)
|
await writeHostList(hostList)
|
||||||
res.success({ data: { len: newHostList.length } })
|
res.success({ data: { len: newHostList.length } })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user