修改返回值

This commit is contained in:
wucongxing8150 2024-08-14 09:23:14 +08:00
parent fbb5b0bfd6
commit df10a9a6cd

View File

@ -13,9 +13,9 @@ type res struct {
} }
func result(code int, data interface{}, msg string, c *gin.Context) { func result(code int, data interface{}, msg string, c *gin.Context) {
if data == nil { //if data == nil {
data = gin.H{} // data = gin.H{}
} //}
c.JSON(http.StatusOK, res{ c.JSON(http.StatusOK, res{
code, code,
data, data,