更新邮件页面和管理API
This commit is contained in:
@@ -1067,13 +1067,13 @@ def test_smtp_config_api(config_id):
|
||||
"""测试SMTP配置"""
|
||||
try:
|
||||
data = request.json or {}
|
||||
test_email = data.get("email", "")
|
||||
test_email = str(data.get("email", "") or "").strip()
|
||||
if not test_email:
|
||||
return jsonify({"error": "请提供测试邮箱"}), 400
|
||||
|
||||
import re
|
||||
|
||||
if not re.match(r"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$", test_email):
|
||||
if not re.match(r"^[^\s@]+@[^\s@]+\.[^\s@]+$", test_email):
|
||||
return jsonify({"error": "邮箱格式不正确"}), 400
|
||||
|
||||
result = email_service.test_smtp_config(config_id, test_email)
|
||||
|
||||
Reference in New Issue
Block a user