This commit is contained in:
toom1996
2025-07-15 17:31:29 +08:00
parent 2b0276f57c
commit 30c9f29e06
2 changed files with 8 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import '../../assets/css1/style5.css'
import { newsDetail } from "../../../utils/rpc";
const { slug } = Astro.params;
const config = getConfig(Astro)
const requestUrl = Astro.request.url;
if (!slug) {
return Astro.redirect('/404');
}
@ -39,9 +40,10 @@ if (!data || code !== 0) {
<Fragment set:html={data.content} />
</article>
<div>
<p>原文地址: xxx</p>
原文地址<a href={`/news/${data.id}`}>{requestUrl}</a>
</div>
<div class="top-icon"></div>
<div class="news-navigation">
{
data.prevNews && (
@ -112,7 +114,8 @@ if (!data || code !== 0) {
.top-icon {
padding-bottom: 30px;
margin-bottom: 1rem;
margin-top: 1rem;
border-bottom: 1px solid #e0e0e0
}
@ -243,11 +246,11 @@ if (!data || code !== 0) {
.news-navigation {
margin-top: 1rem;
padding-top: 2rem;
border-top: 1px solid var(--divider-color);
}
.news-sidebar {
padding: 0 1.5rem 3rem;
/* position: sticky; */
top: 2rem;
height: fit-content;
@ -277,7 +280,7 @@ if (!data || code !== 0) {
flex-direction: column;
text-decoration: none;
transition: all 0.3s ease;
padding: 0.3rem;
padding: 0.2rem;
border-radius: var(--radius-md);
}

View File

@ -44,6 +44,7 @@ export async function newsIndex(websiteId:number = 0):Promise<result<InewsIndex[
// 新闻详情
export interface InewsDetail {
id: number
title: string
keywords: string
description: string