fix: ts类型错误,lightbox错误将link识别为图片的问题
This commit is contained in:
@@ -15,7 +15,7 @@ const {list, total} = await http.get<ApiPageResponse<Post>>("post", {
|
|||||||
});
|
});
|
||||||
const totalPage = Math.ceil(total / metadata.postPageSize)
|
const totalPage = Math.ceil(total / metadata.postPageSize)
|
||||||
|
|
||||||
const {data: categories} = await http.get<ApiPageResponse<CategoriesStats>>("category/stats");
|
const {data: categories} = await http.get<ApiResponse<CategoriesStats[]>>("category/stats");
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout>
|
<Layout>
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ const {list, total} = await http.get<ApiPageResponse<Post>>("post", {
|
|||||||
|
|
||||||
const totalPage = Math.ceil(total / metadata.postPageSize)
|
const totalPage = Math.ceil(total / metadata.postPageSize)
|
||||||
|
|
||||||
if (totalPage < page) {
|
if (totalPage < Number(page)) {
|
||||||
return Astro.redirect('/404')
|
return Astro.redirect('/404')
|
||||||
}
|
}
|
||||||
|
|
||||||
const {data: categories} = await http.get<ApiPageResponse<CategoriesStats>>("category/stats");
|
const {data: categories} = await http.get<ApiResponse<CategoriesStats[]>>("category/stats");
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout>
|
<Layout>
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ const published_at = formatDatetime(data.published_at, 'YYYY 年 M 月 D 日')
|
|||||||
|
|
||||||
const lightbox = new PhotoSwipeLightbox({
|
const lightbox = new PhotoSwipeLightbox({
|
||||||
gallery: ".post",
|
gallery: ".post",
|
||||||
children: "a",
|
children: "a[data-pswp-width]",
|
||||||
pswpModule: () => import("photoswipe"),
|
pswpModule: () => import("photoswipe"),
|
||||||
|
|
||||||
padding: {
|
padding: {
|
||||||
|
|||||||
Reference in New Issue
Block a user