This commit is contained in:
toom1996
2025-07-04 09:49:52 +08:00
parent bcf7b3a25a
commit d723be397f
7 changed files with 76 additions and 19 deletions

View File

@ -1,5 +1,5 @@
import type { IWebsiteConfig } from "./rpc";
import {EXTRA_HONGTIXIANYUE} from './extra.ts'
import {EXTRA_DEFAULT, EXTRA_HONGTIXIANYUE} from './extra.ts'
export function getConfig(Astro: any):IWebsiteConfig
{
@ -7,7 +7,11 @@ export function getConfig(Astro: any):IWebsiteConfig
}
// 取默认的配置
export function getExtra(host: string)
export function getExtra(extraTag: string = '')
{
return EXTRA_HONGTIXIANYUE;
if (extraTag == 'HONGTIXIANYUE') {
return EXTRA_HONGTIXIANYUE;
}
return EXTRA_DEFAULT;
}

View File

@ -1,5 +1,9 @@
// ----- 栏目 -----
export const TP2_COLUMN_INDEX = '首页'
export const TP2_COLUMN_INDEX_URL = '/'
export const TP2_COLUMN_NEWS = '新闻专栏'
export const TP2_COLUMN_NEWS_URL = '/news'

File diff suppressed because one or more lines are too long

View File

@ -31,9 +31,12 @@ export interface InewsIndex {
created_at: string
updated_at: string
}
export async function newsIndex():Promise<result<InewsIndex[]>>{
export async function newsIndex(websiteId:number = 0):Promise<result<InewsIndex[]>>{
console.log(websiteId)
const client = getRpcClient()
const result = await client.call('news/index', {})
const result = await client.call('news/index', {
id:websiteId
})
return result
}
@ -72,6 +75,8 @@ export async function newsDetail(id:string):Promise<result<InewsDetail>>{
// 网站配置
export interface IWebsiteConfig {
id: string
app_extra_tag: string
app_name: string
app_description: string
app_keywords: string