From 777e175f5ffc22a6378e7c99a653d8f2f5f1bded Mon Sep 17 00:00:00 2001 From: zhengkunwang223 Date: Thu, 22 Dec 2022 10:34:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9dns=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=B8=BAPost=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/v1/website_dns_account.go | 6 +++--- backend/router/ro_website_dns_account.go | 2 +- frontend/src/api/modules/website.ts | 4 ++-- frontend/src/views/website/ssl/dns-account/index.vue | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) 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(); };