fix
This commit is contained in:
@@ -39,10 +39,10 @@ func (h *Menu) Create(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if err := h.service.Create(c.Request.Context(), &req); err != nil {
|
||||
httpx.Fail(c, "新增失败")
|
||||
httpx.Fail(c, "添加失败:"+err.Error())
|
||||
return
|
||||
}
|
||||
httpx.OK(c)
|
||||
httpx.Write(c, httpx.CodeSuccess, gin.H{}, "添加成功")
|
||||
}
|
||||
|
||||
func (h *Menu) Update(c *gin.Context) {
|
||||
@@ -55,7 +55,7 @@ func (h *Menu) Update(c *gin.Context) {
|
||||
httpx.Fail(c, "更新失败")
|
||||
return
|
||||
}
|
||||
httpx.OK(c)
|
||||
httpx.Write(c, httpx.CodeSuccess, gin.H{}, "更新成功")
|
||||
}
|
||||
|
||||
func (h *Menu) Delete(c *gin.Context) {
|
||||
@@ -65,10 +65,10 @@ func (h *Menu) Delete(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if err := h.service.Delete(c.Request.Context(), req.ID); err != nil {
|
||||
httpx.Fail(c, err.Error())
|
||||
httpx.Fail(c, "删除失败:"+err.Error())
|
||||
return
|
||||
}
|
||||
httpx.OK(c)
|
||||
httpx.Write(c, httpx.CodeSuccess, gin.H{}, "删除成功")
|
||||
}
|
||||
|
||||
func (h *Menu) Find(c *gin.Context) {
|
||||
@@ -95,7 +95,7 @@ func (h *Menu) SetAuthorityMenus(c *gin.Context) {
|
||||
httpx.Fail(c, "添加失败")
|
||||
return
|
||||
}
|
||||
httpx.OK(c)
|
||||
httpx.Write(c, httpx.CodeSuccess, gin.H{}, "添加成功")
|
||||
}
|
||||
|
||||
func (h *Menu) AuthorityMenus(c *gin.Context) {
|
||||
@@ -143,5 +143,5 @@ func (h *Menu) SetRoles(c *gin.Context) {
|
||||
httpx.Fail(c, "设置失败")
|
||||
return
|
||||
}
|
||||
httpx.OK(c)
|
||||
httpx.Write(c, httpx.CodeSuccess, gin.H{}, "设置成功")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user