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

24 lines
761 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 WebsiteService {
/** 按目标导出所有网站 URL文本文件一行一个 */
static async exportWebsitesByTargetId(targetId: number): Promise<Blob> {
const response = await api.get<Blob>(`/targets/${targetId}/websites/export/`, {
responseType: "blob",
})
return response.data
}
/** 按扫描任务导出所有网站 URL文本文件一行一个 */
static async exportWebsitesByScanId(scanId: number): Promise<Blob> {
const response = await api.get<Blob>(`/scans/${scanId}/websites/export/`, {
responseType: "blob",
})
return response.data
}
}