- buildCacheKey to buildCacheKey4Verify
This commit is contained in:
@@ -103,18 +103,18 @@ func (a *DefAuther) UnionFindAuthBind(curAuthType string, unionAuthTypeList []st
|
||||
// cache相关
|
||||
|
||||
func (a *DefAuther) SaveVerifyCode(keyID, verifyCode string) {
|
||||
api.Cacher.Set(a.buildCacheKey(keyID), verifyCode, DefVerifyCodeDuration)
|
||||
api.Cacher.Set(a.buildCacheKey4Verify(keyID), verifyCode, DefVerifyCodeDuration)
|
||||
}
|
||||
|
||||
func (a *DefAuther) LoadVerifyCode(keyID string) (verifyCode string) {
|
||||
if value := api.Cacher.Get(a.buildCacheKey(keyID)); value != nil {
|
||||
if value := api.Cacher.Get(a.buildCacheKey4Verify(keyID)); value != nil {
|
||||
return value.(string)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (a *DefAuther) DeleteVerifyCode(keyID string) {
|
||||
api.Cacher.Del(a.buildCacheKey(keyID))
|
||||
api.Cacher.Del(a.buildCacheKey4Verify(keyID))
|
||||
}
|
||||
|
||||
// cache相关
|
||||
@@ -136,7 +136,7 @@ func (a *DefAuther) VerifyCode(keyID, verifyCode string) (isSame bool) {
|
||||
return isSame
|
||||
}
|
||||
|
||||
func (a *DefAuther) buildCacheKey(keyID string) string {
|
||||
func (a *DefAuther) buildCacheKey4Verify(keyID string) string {
|
||||
return strings.Join([]string{
|
||||
VerifyCodeHeader,
|
||||
VerifyCodeVer,
|
||||
|
||||
Reference in New Issue
Block a user