修复限流不返回报错信息的bug

This commit is contained in:
Brandon-lz 2024-12-17 02:03:28 +00:00
parent d24eeefc86
commit f2b1e9a8c6
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ type LimitConfig struct {
func (l LimitConfig) LimitWithTime() gin.HandlerFunc {
return func(c *gin.Context) {
if err := l.CheckOrMark(l.GenerationKey(c), l.Expire, l.Limit); err != nil {
c.JSON(http.StatusOK, gin.H{"code": response.ERROR, "msg": err})
c.JSON(http.StatusOK, gin.H{"code": response.ERROR, "msg": err.Error()})
c.Abort()
return
} else {