mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-03 08:25:04 +00:00
perf: 优化频繁发送短信,将后端的频繁发送警告提示到页面上来提醒用户
This commit is contained in:
@@ -9,7 +9,7 @@ from rest_framework.permissions import AllowAny
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.serializers import ValidationError
|
||||
|
||||
from common.exceptions import UnexpectError
|
||||
from common.exceptions import JMSException, UnexpectError
|
||||
from common.utils import get_logger
|
||||
from users.models.user import User
|
||||
from .. import errors
|
||||
@@ -61,6 +61,8 @@ class MFASendCodeApi(AuthMixin, CreateAPIView):
|
||||
|
||||
try:
|
||||
mfa_backend.send_challenge()
|
||||
except JMSException:
|
||||
raise
|
||||
except Exception as e:
|
||||
raise UnexpectError(str(e))
|
||||
|
||||
|
Reference in New Issue
Block a user