From ad1bbaa32eed2d626415d9be8c0cd7787c7389e8 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 9 May 2025 09:13:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20base=20=E7=9F=AD=E4=BF=A1=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=8A=9F=E8=83=BD=E5=90=AF=E5=8A=A8=E6=8A=9B=E5=87=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/utils/sms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/utils/sms.py b/apps/utils/sms.py index 0bfc6dad..7e3d85bb 100644 --- a/apps/utils/sms.py +++ b/apps/utils/sms.py @@ -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')