feat: 阿里云短信加入auto_log装饰器
This commit is contained in:
parent
1c661631ea
commit
0303184ceb
|
@ -4,11 +4,12 @@ from django.conf import settings
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
from apps.utils.myconfig import myConfig
|
from apps.utils.myconfig import myConfig
|
||||||
|
from apps.utils.decorators import auto_log
|
||||||
|
|
||||||
# 实例化myLogger
|
# 实例化myLogger
|
||||||
myLogger = logging.getLogger('log')
|
myLogger = logging.getLogger('log')
|
||||||
|
|
||||||
|
@auto_log(name='阿里云短信', raise_exception=False, send_mail=True)
|
||||||
def send_sms(phone: str, template_code: int, template_param: dict):
|
def send_sms(phone: str, template_code: int, template_param: dict):
|
||||||
client = AcsClient(myConfig.get_option_value('sms', 'xn_key'), myConfig.get_option_value('sms', 'xn_secret'), 'default')
|
client = AcsClient(myConfig.get_option_value('sms', 'xn_key'), myConfig.get_option_value('sms', 'xn_secret'), 'default')
|
||||||
request = CommonRequest()
|
request = CommonRequest()
|
||||||
|
|
Loading…
Reference in New Issue