perf: Custom SMS (files) support obtaining more user information. (#14486)

* perf: Custom SMS (files) support obtaining more user information.

* perf: Remove the useless modules

* perf: modify

---------

Co-authored-by: jiangweidong <1053570670@qq.com>
This commit is contained in:
fit2bot
2024-11-20 10:29:14 +08:00
committed by GitHub
parent f92c557235
commit e2904ab042
7 changed files with 44 additions and 16 deletions

View File

@@ -43,7 +43,7 @@ class SMS:
**kwargs
)
def send_verify_code(self, phone_number, code):
def send_verify_code(self, phone_number, code, **kwargs):
prefix = getattr(self.client, 'SIGN_AND_TMPL_SETTING_FIELD_PREFIX', '')
sign_name = getattr(settings, f'{prefix}_VERIFY_SIGN_NAME', None)
template_code = getattr(settings, f'{prefix}_VERIFY_TEMPLATE_CODE', None)
@@ -53,4 +53,7 @@ class SMS:
code='verify_code_sign_tmpl_invalid',
detail=_('SMS verification code signature or template invalid')
)
return self.send_sms([phone_number], sign_name, template_code, OrderedDict(code=code))
return self.send_sms(
[phone_number], sign_name, template_code,
OrderedDict(code=code), **kwargs
)