This commit is contained in:
toom1996
2025-07-11 14:47:56 +08:00
parent 9da2708d6d
commit 8b31aa1355
78 changed files with 4881 additions and 12 deletions

View File

@ -1,5 +1,5 @@
import type { IWebsiteConfig } from "./rpc";
import {EXTRA_DEFAULT, EXTRA_HONGTIXIANYUE, EXTRA_MINGWUZHITANG, EXTRA_ZHISHIHUISHENG} from './extra.ts'
import {EXTRA_DEFAULT, EXTRA_HONGTIXIANYUE, EXTRA_MINGWUZHITANG, EXTRA_ZHISHIHUISHENG, TP3_DEFAULT, TP3_MINGWUZHITANG} from './extra.ts'
export function getConfig(Astro: any):IWebsiteConfig
{
@ -9,14 +9,25 @@ export function getConfig(Astro: any):IWebsiteConfig
// 取默认的配置
export function getExtra(extraTag: string = '')
{
console.log(extraTag)
if (extraTag == 'HONGTIXIANYUE') {
return EXTRA_HONGTIXIANYUE;
} else if (extraTag == 'ZHISHIHUISHENG') {
return EXTRA_ZHISHIHUISHENG;
} else if (extraTag == 'MINGWUZHITANG') {
return EXTRA_MINGWUZHITANG;
} else if (extraTag === 'TP3_MINGWUZHITANG') {
return TP3_MINGWUZHITANG
}
return EXTRA_DEFAULT;
}
// 取默认的配置
export function getTp3Extra(extraTag: string = '')
{
if (extraTag === 'TP3_MINGWUZHITANG') {
return TP3_MINGWUZHITANG
}
return TP3_DEFAULT;
}

File diff suppressed because one or more lines are too long

View File

@ -31,11 +31,11 @@ export interface InewsIndex {
created_at: string
updated_at: string
}
export async function newsIndex(websiteId:number = 0):Promise<result<InewsIndex[]>>{
console.log(websiteId)
export async function newsIndex(websiteId:number = 0, limit:number = 10):Promise<result<InewsIndex[]>>{
const client = getRpcClient()
const result = await client.call('news/index', {
id:websiteId
id:websiteId,
limit: limit
})
return result
@ -63,10 +63,11 @@ export interface InewsDetail {
title: string
}
}
export async function newsDetail(id:string):Promise<result<InewsDetail>>{
export async function newsDetail(id:string, app_id:number):Promise<result<InewsDetail>>{
const client = getRpcClient()
const result = await client.call('news/view', {
id:id
id:id,
app_id:app_id
})
return result
@ -81,6 +82,7 @@ export interface IWebsiteConfig {
app_description: string
app_keywords: string
app_company: string
app_template: string
app_logo: string
app_favicon: string
app_copyright: string