This commit is contained in:
make
2025-04-27 21:41:58 +08:00
parent 01873ad043
commit 9431334d6d

View File

@@ -161,6 +161,7 @@ function addBookshelfFun(NovelInfo) {
}
let arrBookshelf = JSON.parse(localStorage.getItem(strBookshelfKey)) || [];
arrBookshelf = [];
// 检查书籍是否已存在
const index = arrBookshelf.findIndex(item => item.n_id === NovelInfo.n_id);
@@ -294,6 +295,7 @@ function addHistoryFun(NovelInfo) {
// 获取本地存储中的历史记录
let arrBookshelf = JSON.parse(localStorage.getItem(strHistoryKey)) || [];
arrBookshelf = [];
// 检查书籍是否已存在
const index = arrBookshelf.findIndex(item => item.n_id == NovelInfo.n_id);