fix: email code send
This commit is contained in:
parent
fb3edfa7a2
commit
57f300e1a7
|
|
@ -5,7 +5,7 @@ from apps.auth1.serializers import EmailCodeSerializer
|
||||||
from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
from apps.utils.tools import rannum
|
from apps.utils.tools import rannum
|
||||||
from server.settings import get_sysconfig
|
from server.settings import get_sysconfig
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
class EmailCodeView(CreateAPIView):
|
class EmailCodeView(CreateAPIView):
|
||||||
"""发送邮箱验证码
|
"""发送邮箱验证码
|
||||||
|
|
@ -41,7 +41,7 @@ class EmailCodeView(CreateAPIView):
|
||||||
send_mail(
|
send_mail(
|
||||||
subject=f'{base_name_short}-验证码',
|
subject=f'{base_name_short}-验证码',
|
||||||
message=f'您的验证码是:{code},5分钟内有效。如非本人操作,请忽略此邮件。',
|
message=f'您的验证码是:{code},5分钟内有效。如非本人操作,请忽略此邮件。',
|
||||||
from_email=None, # 使用默认发件人
|
from_email=settings.EMAIL_HOST_USER, # 使用默认发件人
|
||||||
recipient_list=[email],
|
recipient_list=[email],
|
||||||
fail_silently=False
|
fail_silently=False
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue