This commit is contained in:
suyl
2021-07-19 18:57:10 +08:00
parent f765774128
commit bca946aadc
2 changed files with 4 additions and 5 deletions

View File

@@ -26,7 +26,6 @@ func checkToken(c *gin.Context) (tokenInfo *model.TokenInfo) {
var (
cookie *http.Cookie
err error
ok bool
token string
user *model.User
)
@@ -105,9 +104,9 @@ 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 := utils.GetKet(c.ClientIP() + model.SessionKey); captchaId != nil {
if captchaId := utils.GetKey(c.ClientIP() + model.SessionKey); captchaId != "" {
utils.DelKey(c.ClientIP() + model.SessionKey)
if captcha.VerifyString(captchaId.(string), code) {
if captcha.VerifyString(captchaId, code) {
return true
} else {
return false