mirror of https://github.com/jumpserver/jumpserver
fix: 修复验证码校验逻辑和报错信息
parent
c369b5478c
commit
1f00c00183
|
@ -51,7 +51,7 @@ class SendAndVerifyCodeUtil(object):
|
||||||
times = cache.get(self.verify_key, 0)
|
times = cache.get(self.verify_key, 0)
|
||||||
if times >= 3:
|
if times >= 3:
|
||||||
self.__clear()
|
self.__clear()
|
||||||
raise CodeError
|
raise CodeExpired
|
||||||
cache.set(self.verify_key, times + 1, timeout=self.timeout)
|
cache.set(self.verify_key, times + 1, timeout=self.timeout)
|
||||||
right = cache.get(self.key)
|
right = cache.get(self.key)
|
||||||
if not right:
|
if not right:
|
||||||
|
@ -65,6 +65,7 @@ class SendAndVerifyCodeUtil(object):
|
||||||
|
|
||||||
def __clear(self):
|
def __clear(self):
|
||||||
cache.delete(self.key)
|
cache.delete(self.key)
|
||||||
|
cache.delete(self.verify_key)
|
||||||
|
|
||||||
def __ttl(self):
|
def __ttl(self):
|
||||||
return cache.ttl(self.key)
|
return cache.ttl(self.key)
|
||||||
|
|
Loading…
Reference in New Issue