update code level

This commit is contained in:
lychang
2026-07-21 00:43:40 +08:00
parent 0a5dd1c920
commit 81bbc67432
3 changed files with 19 additions and 11 deletions

View File

@@ -235,7 +235,7 @@ async function loadAlbum(albumId) {
// 显示骨架屏
showImageSkeleton();
const response = await fetch(`/api/album/${albumId}`);
const response = await fetch(`${API_BASE}/album/${albumId}`);
if (!response.ok) {
if (response.status === 404) {
throw new Error('相册不存在');
@@ -431,7 +431,7 @@ function displayImages() {
let dataSrc = '';
if (image.id) {
dataSrc = `/api/image/${image.id}`;
dataSrc = `${API_BASE}/image/${image.id}`;
imageUrl = '/assets/placeholder.svg'; // 初始使用占位图
} else if (image.original_url) {
dataSrc = image.original_url;
@@ -545,7 +545,7 @@ function updateLightboxContent(newIndex) {
// 在lightbox中优先使用原始图片以获得更好的显示效果
let imageUrl = '/assets/placeholder.svg';
if (image.id) {
imageUrl = `/api/image/${image.id}`;
imageUrl = `${API_BASE}/image/${image.id}`;
} else if (image.original_url) {
imageUrl = image.original_url;
}

View File

@@ -369,7 +369,7 @@ function appendAlbums(albums) {
let dataSrc = '';
if (album.cover_image_id) {
dataSrc = `/api/image/${album.cover_image_id}`;
dataSrc = `${API_BASE}/image/${album.cover_image_id}`;
coverImageUrl = '/assets/placeholder.svg'; // 初始使用占位图
}
@@ -585,7 +585,7 @@ function displayAlbums(albums) {
let dataSrc = '';
if (album.cover_image_id) {
dataSrc = `/api/image/${album.cover_image_id}`;
dataSrc = `${API_BASE}/image/${album.cover_image_id}`;
coverImageUrl = '/assets/placeholder.svg'; // 初始使用占位图
}
@@ -1495,12 +1495,21 @@ async function filterByPerson(personName) {
}
} catch (e) { /* 回退 */ }
}
// 回退到全站搜索,也要保存过滤结果
// 回退到全站搜索
filteredAlbums = await performServerSearchWithResult(personName);
} catch (error) {
console.error('人物筛选失败:', error);
filteredAlbums = await performServerSearchWithResult(personName);
}
// 无论回退搜索是否找到结果,都要渲染页面(移除骨架屏)
if (filteredAlbums !== null) {
currentDisplayPage = 1;
hasMoreAlbums = filteredAlbums.length > albumsPerPage;
displayAlbums(filteredAlbums);
updateStats(filteredAlbums);
initLazyLoading();
}
}
// 显示筛选状态