From 0c4873884184eac6a135e44b86dd4985df4076c7 Mon Sep 17 00:00:00 2001 From: youngsterxyf Date: Fri, 8 Jan 2016 21:29:12 +0800 Subject: [PATCH] for issue #1530, fix incompatible bug --- utils/captcha/captcha.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/captcha/captcha.go b/utils/captcha/captcha.go index 76301a03..4ac5c9f9 100644 --- a/utils/captcha/captcha.go +++ b/utils/captcha/captcha.go @@ -64,6 +64,7 @@ import ( "net/http" "path" "strings" + "time" "github.com/astaxie/beego" "github.com/astaxie/beego/cache" @@ -78,7 +79,7 @@ var ( const ( // default captcha attributes challengeNums = 6 - expiration = 600 + expiration = 600 * time.Second fieldIDName = "captcha_id" fieldCaptchaName = "captcha" cachePrefix = "captcha_" @@ -106,7 +107,7 @@ type Captcha struct { ChallengeNums int // captcha expiration seconds - Expiration int64 + Expiration time.Duration // cache key prefix CachePrefix string