fix(frontend): query schemes by type

This commit is contained in:
2026-07-30 11:01:45 +08:00
parent 4596af7c12
commit 7745333a58
7 changed files with 62 additions and 30 deletions
@@ -79,18 +79,21 @@ const SchemeQuery: React.FC<Props> = ({
const handleQuery = async () => {
setLoading(true);
try {
const params: Record<string, string> = { network: NETWORK_NAME };
const params: Record<string, string> = {
network: NETWORK_NAME,
scheme_type: "dma_leak_identification",
};
if (!queryAll && queryDate) {
params.query_date = queryDate.startOf("day").toISOString();
}
const response = await api.get(`${config.BACKEND_URL}/api/v1/leakage/schemes/`, {
const response = await api.get(`${config.BACKEND_URL}/api/v1/schemes`, {
params,
});
const nextSchemes = response.data as LeakageSchemeRecord[];
setSchemes(nextSchemes);
if (nextSchemes.length === 0) {
open?.({
type: "error",
type: "success",
message: "查询结果",
description: queryAll
? "没有找到任何方案"
@@ -117,8 +120,13 @@ const SchemeQuery: React.FC<Props> = ({
const handleViewSchemeResult = async (schemeName: string) => {
try {
const response = await api.get(
`${config.BACKEND_URL}/api/v1/leakage/schemes/${encodeURIComponent(schemeName)}`,
{ params: { network: NETWORK_NAME } },
`${config.BACKEND_URL}/api/v1/schemes/${encodeURIComponent(schemeName)}`,
{
params: {
network: NETWORK_NAME,
scheme_type: "dma_leak_identification",
},
},
);
onViewResult(response.data as LeakageResultDetail);
} catch (error: any) {