From 4ffa729c14db8c2a9f09d50f0f27f1b18f016e38 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Sat, 19 Oct 2024 06:41:59 +0800 Subject: [PATCH] fix(web): author of book can be null --- modules/web/src/views/BookChapter.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/web/src/views/BookChapter.vue b/modules/web/src/views/BookChapter.vue index 42bd3f920..83d5ad202 100644 --- a/modules/web/src/views/BookChapter.vue +++ b/modules/web/src/views/BookChapter.vue @@ -482,7 +482,7 @@ onMounted(async () => { const chapterIndex = Number(sessionStorage.getItem('chapterIndex') || 0) const chapterPos = Number(sessionStorage.getItem('chapterPos') || 0) const isSeachBook = sessionStorage.getItem('isSeachBook') === 'true' - if (isNullOrBlank(bookUrl) || isNullOrBlank(name) || isNullOrBlank(author)) { + if (isNullOrBlank(bookUrl) || isNullOrBlank(name) || author === null) { ElMessage.warning('书籍信息为空,即将自动返回书架页面...') return setTimeout(toShelf, 500) } @@ -539,7 +539,7 @@ const addToBookShelfConfirm = async () => { confirmButtonText: '确认', cancelButtonText: '否', type: 'info', - /* + /* ElMessageBox.confirm默认在触发hashChange事件时自动关闭 按下物理返回键时触发hashChange事件 使用router.push("/")则不会触发hashChange事件