mirror of
https://gitee.com/shikong-sk/gofiber-study
synced 2025-02-23 23:32:15 +08:00
验证码忽略大小写
This commit is contained in:
parent
9192b4d35a
commit
a4a9b27e5a
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"github.com/go-redis/redis/v8"
|
"github.com/go-redis/redis/v8"
|
||||||
"github.com/mojocn/base64Captcha"
|
"github.com/mojocn/base64Captcha"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -44,6 +45,6 @@ func (c *CaptchaStore) Get(id string, clear bool) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *CaptchaStore) Verify(id, answer string, clear bool) (match bool) {
|
func (c *CaptchaStore) Verify(id, answer string, clear bool) (match bool) {
|
||||||
match = c.Get(id, clear) == answer
|
match = strings.EqualFold(c.Get(id, clear), answer)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user