import request from "@/utils/request.js";

// 获取域名白名单列表
export function getDomainList(params) {
  return request.get("/api/v1/admin/server/domain_withe/list",params)
}

// 添加域名白名单
export function addDomain(data) {
  return request.post("/api/v1/admin/server/domain_withe/add",data)
}

// 删除域名白名单
export function deleteDomain(data) {
  return request.post("/api/v1/admin/server/domain_withe/delete",data,{
  
    headers:{
      'Content-Type':'multipart/form-data'
    }
  }) 
}

// 批量删除域名白名单
export async function batchDeleteDomain(ids) {
    let promises = []
    for (let id of ids) {
        promises.push(deleteDomain({domain_id:id}))
    }
    return await Promise.all(promises)
} 