diff --git a/backend/app/api/v1/website_dns_account.go b/backend/app/api/v1/website_dns_account.go index 1de026761..d6f9d773f 100644 --- a/backend/app/api/v1/website_dns_account.go +++ b/backend/app/api/v1/website_dns_account.go @@ -52,13 +52,13 @@ func (b *BaseApi) UpdateWebsiteDnsAccount(c *gin.Context) { } func (b *BaseApi) DeleteWebsiteDnsAccount(c *gin.Context) { - id, err := helper.GetParamID(c) - if err != nil { + var req request.WebsiteResourceReq + if err := c.ShouldBindJSON(&req); err != nil { helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err) return } - if err := websiteDnsAccountService.Delete(id); err != nil { + if err := websiteDnsAccountService.Delete(req.ID); err != nil { helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) return } diff --git a/backend/router/ro_website_dns_account.go b/backend/router/ro_website_dns_account.go index 6e7673e0a..cf4172614 100644 --- a/backend/router/ro_website_dns_account.go +++ b/backend/router/ro_website_dns_account.go @@ -18,6 +18,6 @@ func (a *WebsiteDnsAccountRouter) InitWebsiteDnsAccountRouter(Router *gin.Router groupRouter.POST("/search", baseApi.PageWebsiteDnsAccount) groupRouter.POST("", baseApi.CreateWebsiteDnsAccount) groupRouter.POST("/update", baseApi.UpdateWebsiteDnsAccount) - groupRouter.DELETE("/:id", baseApi.DeleteWebsiteDnsAccount) + groupRouter.POST("/del", baseApi.DeleteWebsiteDnsAccount) } } diff --git a/frontend/src/api/modules/website.ts b/frontend/src/api/modules/website.ts index b6f70b387..645f2ae9f 100644 --- a/frontend/src/api/modules/website.ts +++ b/frontend/src/api/modules/website.ts @@ -91,8 +91,8 @@ export const UpdateDnsAccount = (req: Website.DnsAccountUpdate) => { return http.post(`/websites/dns/update`, req); }; -export const DeleteDnsAccount = (id: number) => { - return http.delete(`/websites/dns/${id}`); +export const DeleteDnsAccount = (req: Website.DelReq) => { + return http.post(`/websites/dns/del`, req); }; export const SearchAcmeAccount = (req: ReqPage) => { diff --git a/frontend/src/views/website/ssl/dns-account/index.vue b/frontend/src/views/website/ssl/dns-account/index.vue index fab927c7b..a2394df96 100644 --- a/frontend/src/views/website/ssl/dns-account/index.vue +++ b/frontend/src/views/website/ssl/dns-account/index.vue @@ -87,7 +87,7 @@ const openEdit = (form: Website.DnsAccount) => { const deleteAccount = async (id: number) => { loading.value = true; - await useDeleteData(DeleteDnsAccount, id, 'commons.msg.delete'); + await useDeleteData(DeleteDnsAccount, { id: id }, 'commons.msg.delete'); loading.value = false; search(); };