[skip ci] web: 重构章节内容及其进度

This commit is contained in:
Xwite
2023-05-12 21:05:53 +08:00
parent 1ebf3491f4
commit 16c2791184
5 changed files with 183 additions and 167 deletions
+5 -3
View File
@@ -187,7 +187,7 @@ const toDetail = (bookUrl, bookName, bookAuthor, chapterIndex, chapterPos) => {
});
};
onMounted(async () => {
onMounted(() => {
//获取最近阅读书籍
let readingRecentStr = localStorage.getItem("readingRecent");
if (readingRecentStr != null) {
@@ -197,8 +197,10 @@ onMounted(async () => {
}
}
showLoading.value = true;
await store.saveBookProcess();
fetchBookShelfData();
store
.saveBookProgress()
//确保各种网络情况下同步请求先完成
.finally(fetchBookShelfData);
});
const fetchBookShelfData = () => {
API.getBookShelf()