feat: base 短信发送功能启动抛出异常2
This commit is contained in:
parent
1c8489a0b4
commit
ad1bbaa32e
|
@ -4,6 +4,7 @@ import json
|
|||
import logging
|
||||
from server.settings import get_sysconfig
|
||||
from apps.utils.decorators import auto_log
|
||||
from rest_framework.exceptions import ParseError
|
||||
|
||||
# 实例化myLogger
|
||||
myLogger = logging.getLogger('log')
|
||||
|
@ -13,7 +14,7 @@ myLogger = logging.getLogger('log')
|
|||
def send_sms(phone: str, template_code: int, template_param: dict):
|
||||
config = get_sysconfig()
|
||||
if config.get("sms", {}).get('enabled', False) is False:
|
||||
raise Exception("短信发送功能未启用")
|
||||
raise ParseError("短信发送功能未启用")
|
||||
try:
|
||||
client = AcsClient(config['sms']['xn_key'],
|
||||
config['sms']['xn_secret'], 'default')
|
||||
|
|
Loading…
Reference in New Issue