fix: publickey

This commit is contained in:
ttk
2024-09-02 18:51:26 +08:00
parent 5caf481b68
commit c09565d673
11 changed files with 1038 additions and 54 deletions

View File

@@ -27,7 +27,7 @@ func (c *Controller) PostConfig(ctx *gin.Context) {
}
cfg := &model.Config{}
if err := ctx.BindJSON(cfg); err != nil {
if err := ctx.ShouldBindBodyWithJSON(cfg); err != nil {
ctx.AbortWithError(http.StatusBadRequest, &ApiError{Code: ErrInvalidArgument, Data: map[string]any{"err": err}})
return
}