mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 16:29:17 +08:00
feat: 修改dns删除为Post接口
This commit is contained in:
parent
fe8601f753
commit
777e175f5f
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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) => {
|
||||
|
@ -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();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user