看股功能更新

This commit is contained in:
2026-08-15 15:36:11 +08:00
parent c1c43d2ff7
commit 9cce670b74
26 changed files with 957 additions and 427 deletions

View File

@@ -135,14 +135,17 @@ export async function getStockPreview(
adjust?: AdjustMode;
timeframe?: Timeframe;
mas?: number[];
/** 向前翻页:返回该日期(不含)之前的 limit 根 K 线 + 预热好的指标 */
end?: string;
} = {},
): Promise<PreviewResponse> {
const { limit = 10000, adjust = 'qfq', timeframe = '1d', mas } = opts;
const { limit = 500, adjust = 'qfq', timeframe = '1d', mas, end } = opts;
const q = new URLSearchParams({
limit: String(limit),
adjust,
timeframe,
...(mas?.length ? { mas: mas.join(',') } : {}),
...(end ? { end } : {}),
});
const res = await apiFetch(`/api/screener/preview/${encodeURIComponent(tsCode)}?${q.toString()}`);
if (!res.ok) throw new ApiError(await readError(res, `获取个股详情失败 (HTTP ${res.status})`), res.status);