mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-10 17:13:30 +08:00
feat: 修改acme删除接口为post
This commit is contained in:
parent
198db6ddb5
commit
fe8601f753
6 changed files with 15 additions and 8 deletions
|
@ -40,13 +40,12 @@ func (b *BaseApi) CreateWebsiteAcmeAccount(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseApi) DeleteWebsiteAcmeAccount(c *gin.Context) {
|
func (b *BaseApi) DeleteWebsiteAcmeAccount(c *gin.Context) {
|
||||||
id, err := helper.GetParamID(c)
|
var req request.WebsiteResourceReq
|
||||||
if err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
|
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if err := websiteAcmeAccountService.Delete(req.ID); err != nil {
|
||||||
if err := websiteAcmeAccountService.Delete(id); err != nil {
|
|
||||||
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,3 +39,7 @@ type WebsiteDnsAccountUpdate struct {
|
||||||
Type string `json:"type" validate:"required"`
|
Type string `json:"type" validate:"required"`
|
||||||
Authorization map[string]string `json:"authorization" validate:"required"`
|
Authorization map[string]string `json:"authorization" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type WebsiteResourceReq struct {
|
||||||
|
ID uint `json:"id" validate:"required"`
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,6 @@ func (a *WebsiteAcmeAccountRouter) InitWebsiteAcmeAccountRouter(Router *gin.Rout
|
||||||
{
|
{
|
||||||
groupRouter.POST("/search", baseApi.PageWebsiteAcmeAccount)
|
groupRouter.POST("/search", baseApi.PageWebsiteAcmeAccount)
|
||||||
groupRouter.POST("", baseApi.CreateWebsiteAcmeAccount)
|
groupRouter.POST("", baseApi.CreateWebsiteAcmeAccount)
|
||||||
groupRouter.DELETE("/:id", baseApi.DeleteWebsiteAcmeAccount)
|
groupRouter.POST("/del", baseApi.DeleteWebsiteAcmeAccount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,4 +228,8 @@ export namespace Website {
|
||||||
websiteId: number;
|
websiteId: number;
|
||||||
key: string;
|
key: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DelReq {
|
||||||
|
id: number;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,8 +103,8 @@ export const CreateAcmeAccount = (req: Website.AcmeAccountCreate) => {
|
||||||
return http.post<Website.AcmeAccount>(`/websites/acme`, req);
|
return http.post<Website.AcmeAccount>(`/websites/acme`, req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DeleteAcmeAccount = (id: number) => {
|
export const DeleteAcmeAccount = (req: Website.DelReq) => {
|
||||||
return http.delete<any>(`/websites/acme/${id}`);
|
return http.post<any>(`/websites/acme/del`, req);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SearchSSL = (req: ReqPage) => {
|
export const SearchSSL = (req: ReqPage) => {
|
||||||
|
|
|
@ -71,7 +71,7 @@ const openCreate = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteAccount = async (id: number) => {
|
const deleteAccount = async (id: number) => {
|
||||||
await useDeleteData(DeleteAcmeAccount, id, 'commons.msg.delete');
|
await useDeleteData(DeleteAcmeAccount, { id: id }, 'commons.msg.delete');
|
||||||
search();
|
search();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue