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

@@ -94,9 +94,8 @@ func callFunc(c *gin.Context, worker func() (retVal interface{}, errCode string,
func captchaVerify(c *gin.Context, code string) bool {
session := sessions.Default(c)
if captchaId := session.Get(model.SessionKey); captchaId != nil {
globals.SugarLogger.Debugf("captchaVerify capid :%v", captchaId)
session.Delete(model.SessionKey)
if captchaId := session.Get(c.ClientIP() + model.SessionKey); captchaId != nil {
session.Delete(c.ClientIP() + model.SessionKey)
_ = session.Save()
if captcha.VerifyString(captchaId.(string), code) {
return true
@@ -104,7 +103,6 @@ func captchaVerify(c *gin.Context, code string) bool {
return false
}
} else {
globals.SugarLogger.Debugf("captchaVerify2 capid :%v", captchaId)
return false
}
}