feat: 热点股追踪增加近3/5/10交易日筛选

This commit is contained in:
Sakurasan
2026-09-17 20:34:42 +08:00
parent 229362533b
commit 1df1f77b13
3 changed files with 23 additions and 12 deletions
+3 -3
View File
@@ -33,11 +33,11 @@ export interface CoreStockHistoryResponse {
items: CoreStockHistoryItem[];
}
/** 获取活跃核心股 + 最近10日涨幅矩阵 */
export async function fetchActiveCoreStocks(): Promise<ActiveCoreStocksResponse> {
/** 获取活跃核心股 + 最近N日涨幅矩阵 */
export async function fetchActiveCoreStocks(days: number = 10): Promise<ActiveCoreStocksResponse> {
const baseUrl = getApiBaseUrl();
try {
const resp = await fetch(`${baseUrl}/api/core-stocks/active`, { method: "GET", cache: "no-store" });
const resp = await fetch(`${baseUrl}/api/core-stocks/active?days=${days}`, { method: "GET", cache: "no-store" });
if (!resp.ok) return { dates: [], stocks: [] };
return resp.json();
} catch (err) {