1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

feat: 修改dns删除为Post接口

This commit is contained in:
zhengkunwang223 2022-12-22 10:34:02 +08:00 committed by zhengkunwang223
parent fe8601f753
commit 777e175f5f
4 changed files with 7 additions and 7 deletions

View File

@ -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
}

View File

@ -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)
}
}

View File

@ -91,8 +91,8 @@ export const UpdateDnsAccount = (req: Website.DnsAccountUpdate) => {
return http.post<any>(`/websites/dns/update`, req);
};
export const DeleteDnsAccount = (id: number) => {
return http.delete<any>(`/websites/dns/${id}`);
export const DeleteDnsAccount = (req: Website.DelReq) => {
return http.post<any>(`/websites/dns/del`, req);
};
export const SearchAcmeAccount = (req: ReqPage) => {

View File

@ -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();
};