更新BK缓存策略

This commit is contained in:
Sakurasan
2026-07-08 00:33:15 +08:00
parent 1a50f7680a
commit 015aeb989a
3 changed files with 55 additions and 22 deletions
+2 -2
View File
@@ -458,12 +458,12 @@ export interface SectorResponse {
* 获取东方财富板块列表(按主力净流入排序)
* @param type industry=行业板块, concept=概念板块
*/
export async function fetchSectors(type: SectorType): Promise<SectorItem[]> {
export async function fetchSectors(type: SectorType, signal?: AbortSignal): Promise<SectorItem[]> {
const baseUrl = getApiBaseUrl();
const url = `${baseUrl}/api/sectors?type=${type}`;
try {
const resp = await fetch(url, { method: "GET" });
const resp = await fetch(url, { method: "GET", signal });
if (!resp.ok) return [];
const result: SectorResponse = await resp.json();
return result.data || [];