ip session

This commit is contained in:
suyl
2021-07-13 18:25:05 +08:00
parent e41dbfc9cc
commit 826975c1b3
3 changed files with 3 additions and 6 deletions

View File

@@ -66,7 +66,7 @@ func Captcha(c *gin.Context, length ...int) {
}
captchaId := captcha.NewLen(l)
session := sessions.Default(c)
session.Set(model.SessionKey, captchaId)
session.Set(c.ClientIP()+model.SessionKey, captchaId)
_ = session.Save()
_ = Serve(c.Writer, c.Request, captchaId, ".png", "zh", false, w, h)
}