Documentation
¶
Overview ¶
Package verifycode 用以发送手机验证码和邮箱验证码
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RedisStore ¶
type RedisStore struct {
RedisClient *wtredis.RedisClient
KeyPrefix string
}
RedisStore 实现 verifycode.Store interface
func (*RedisStore) Set ¶
func (s *RedisStore) Set(key string, value string) bool
Set 实现 verifycode.Store interface 的 Set 方法
func (*RedisStore) Verify ¶
func (s *RedisStore) Verify(key, answer string) bool
Verify 实现 verifycode.Store interface 的 Verify 方法
type VerifyCode ¶
type VerifyCode struct {
Store Store
}
func (*VerifyCode) CheckAnswer ¶
func (vc *VerifyCode) CheckAnswer(key string, answer string) bool
CheckAnswer 检查用户提交的验证码是否正确,key 可以是手机号或者 Email
func (*VerifyCode) SendSMS ¶
func (vc *VerifyCode) SendSMS(phone string) error
Click to show internal directories.
Click to hide internal directories.