perf: cancel the request when leaving page

This commit is contained in:
jialin
2026-01-16 16:53:38 +08:00
parent 3e359a69c7
commit b4f69a4e2e
6 changed files with 60 additions and 44 deletions
+8 -2
View File
@@ -156,9 +156,15 @@ export async function queryClusterItem(params: { id: number }, options?: any) {
});
}
export async function queryClusterToken(params: { id: number }) {
export async function queryClusterToken(
params: { id: number },
options?: {
token?: any;
}
) {
return request(`${CLUSTERS_API}/${params.id}/${CLUSTER_TOKEN}`, {
method: 'GET'
method: 'GET',
cancelToken: options?.token
});
}