This commit is contained in:
toom1996
2025-07-14 11:29:33 +08:00
parent 605b324ba2
commit e86e2f0e01
2 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ if (!slug) {
return Astro.redirect('/404'); return Astro.redirect('/404');
} }
const {code, data} = await newsDetail(slug); const {code, data} = await newsDetail(slug, config);
if (!data || code !== 0) { if (!data || code !== 0) {
return Astro.redirect('/404'); return Astro.redirect('/404');

View File

@ -63,12 +63,12 @@ export interface InewsDetail {
title: string title: string
} }
} }
export async function newsDetail(id:string):Promise<result<InewsDetail>>{ export async function newsDetail(id:string, config: IWebsiteConfig):Promise<result<InewsDetail>>{
const client = getRpcClient() const client = getRpcClient()
const result = await client.call('news/view', { const result = await client.call('news/view', {
id:id id:id,
app_id: config.id
}) })
return result return result
} }