update
This commit is contained in:
@ -10,7 +10,7 @@ if (!slug) {
|
||||
return Astro.redirect('/404');
|
||||
}
|
||||
|
||||
const {code, data} = await newsDetail(slug);
|
||||
const {code, data} = await newsDetail(slug, config);
|
||||
|
||||
if (!data || code !== 0) {
|
||||
return Astro.redirect('/404');
|
||||
|
@ -63,12 +63,12 @@ export interface InewsDetail {
|
||||
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 result = await client.call('news/view', {
|
||||
id:id
|
||||
id:id,
|
||||
app_id: config.id
|
||||
})
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user