File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
blog-web/src/components/solid Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ function formatDate(dateString: string) {
2929// 获取文章数据的函数
3030async function fetchPosts ( ) : Promise < Post [ ] > {
3131 try {
32- const response = await http . get < Post [ ] > ( "/posts" ) ;
32+ const response = await http . get < Post [ ] > ( "/posts" , { withToken : false } ) ;
3333
3434 // 检查响应格式,直接处理返回的数组数据
3535 if ( response && Array . isArray ( response ) ) {
@@ -58,7 +58,7 @@ export default function BlogPosts() {
5858 < div class = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 my-8" >
5959 < Show when = { ! posts . loading } fallback = { < div class = "col-span-full text-center" > 加载中...</ div > } >
6060 < Show
61- when = { posts ( ) && posts ( ) . length > 0 }
61+ when = { posts ( ) && posts ( ) ! . length > 0 }
6262 fallback = {
6363 < div class = "col-span-full text-center py-12" >
6464 < div class = "alert alert-info shadow-lg max-w-md mx-auto" >
You can’t perform that action at this time.
0 commit comments