From 08615a9784d95961eab1092527682a713066c433 Mon Sep 17 00:00:00 2001 From: mmdctjj <984808285@qq.com> Date: Thu, 11 Jun 2026 19:34:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B0=81=E9=9D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/desktop/src/pages/Admin.tsx | 36 +++--- apps/desktop/src/pages/AuthorDetail.tsx | 41 +++--- apps/desktop/src/pages/BookDetail.tsx | 41 +++--- apps/desktop/src/pages/CollectionDetail.tsx | 42 ++++--- apps/desktop/src/pages/Library.tsx | 131 +++++++++++--------- apps/desktop/src/pages/Profile.tsx | 49 ++++---- apps/desktop/src/pages/Reader-TTS.tsx | 39 +++--- apps/desktop/src/pages/Recommend.tsx | 79 +++++------- 8 files changed, 243 insertions(+), 215 deletions(-) diff --git a/apps/desktop/src/pages/Admin.tsx b/apps/desktop/src/pages/Admin.tsx index 9b8823e8..613fa11b 100644 --- a/apps/desktop/src/pages/Admin.tsx +++ b/apps/desktop/src/pages/Admin.tsx @@ -4,6 +4,27 @@ import { Routes, Route, Link, useLocation } from 'react-router-dom'; import { getApiClient, User, EbookSource, Book } from '@bookdock/api-client'; import { getCoverImageUrl } from '../utils/network'; import { Button, Card, CardHeader, CardTitle, CardContent, Input } from '@bookdock/ui'; + +function BookCover({ book, className = "" }: { book: Book; className?: string }) { + const [coverError, setCoverError] = useState(false); + const coverSrc = getCoverImageUrl(book.coverUrl); + return ( +
{book.title}
diff --git a/apps/desktop/src/pages/BookDetail.tsx b/apps/desktop/src/pages/BookDetail.tsx index 87d986d4..03dd2348 100644 --- a/apps/desktop/src/pages/BookDetail.tsx +++ b/apps/desktop/src/pages/BookDetail.tsx @@ -17,6 +17,29 @@ import { useCallback, useEffect, useMemo, useState } from "react"; import { useNavigate, useParams } from "react-router-dom"; import { getCoverImageUrl } from "../utils/network"; +function BookCover({ book, className = "" }: { book: Book; className?: string }) { + const [coverError, setCoverError] = useState(false); + const coverSrc = getCoverImageUrl(book.coverUrl); + return ( ++ {book.author || "未知作者"} +
+- {book.author || "未知作者"} -
-{book.title}
-{book.author || "未知作者"}
+ function BookCard({ book }: { book: Book }) { + const [coverError, setCoverError] = useState(false); + const coverSrc = getCoverImageUrl(book.coverUrl); + return ( +{book.title}
+{book.author || "未知作者"}
+暂无在读书籍
) : ( - inProgressBooks.map(renderBookCard) + inProgressBooks.map((book) =>暂无收藏
) : ( - favorites.map(renderBookCard) + favorites.map((book) =>暂无下载
) : ( - downloadedBooks.map((b) => renderBookCard(b as unknown as Book)) + downloadedBooks.map((b) =>{book.title}
@@ -189,23 +198,7 @@ export default function Recommend() { className="cursor-pointer" onClick={() => handleBookSelect(book)} > -{book.title}
@@ -233,23 +226,7 @@ export default function Recommend() { className="cursor-pointer" onClick={() => handleBookSelect(book)} > -{book.title}