Files
xingrin/frontend/services/directory.service.ts
2025-12-12 18:04:57 +08:00

21 lines
710 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { api } from "@/lib/api-client"
/** 目录相关 API 服务 */
export class DirectoryService {
/** 按目标导出所有目录 URL文本文件一行一个 */
static async exportDirectoriesByTargetId(targetId: number): Promise<Blob> {
const response = await api.get<Blob>(`/targets/${targetId}/directories/export/`, {
responseType: "blob",
})
return response.data
}
/** 按扫描任务导出所有目录 URL文本文件一行一个 */
static async exportDirectoriesByScanId(scanId: number): Promise<Blob> {
const response = await api.get<Blob>(`/scans/${scanId}/directories/export/`, {
responseType: "blob",
})
return response.data
}
}