diff --git a/controller/message.go b/controller/message.go
index 9f05f6f..ea9ce3b 100644
--- a/controller/message.go
+++ b/controller/message.go
@@ -128,7 +128,14 @@ func SendMessageV2(c *gin.Context) {
})
return
}
-
+ //限流
+ if !tools.LimitFreqSingle("sendmessage:"+c.ClientIP(), 1, 2) {
+ c.JSON(200, gin.H{
+ "code": 400,
+ "msg": c.ClientIP() + "发送频率过快",
+ })
+ return
+ }
var kefuInfo models.User
var vistorInfo models.Visitor
if cType == "kefu" {
diff --git a/static/html/chat_page.html b/static/html/chat_page.html
index 6a8c30e..cd00782 100644
--- a/static/html/chat_page.html
+++ b/static/html/chat_page.html
@@ -76,5 +76,5 @@
var LANG=checkLang();
-
+