Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ aiosqlite>=0.19.0
psycopg[binary]>=3.1.18
# 自动绑卡(local_auto)依赖
playwright>=1.40.0
requests>=2.33.1
3 changes: 3 additions & 0 deletions src/web/routes/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,9 @@ async def update_email_service(service_id: int, request: EmailServiceUpdate):
# 合并配置而不是替换
current_config = normalize_email_service_config(service.service_type, service.config)
merged_config = {**current_config, **request.config}
# 显式清空 CloudMail 子域名
if "subdomain" in request.config and not str(request.config.get("subdomain") or "").strip():
merged_config.pop("subdomain", None)
# 移除空值
merged_config = {k: v for k, v in merged_config.items() if v}
update_data["config"] = normalize_email_service_config(service.service_type, merged_config)
Expand Down
8 changes: 3 additions & 5 deletions static/js/email_services.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ async function handleAddCustom(e) {
domain: formData.get('fm_domain')
};
} else if (subType === 'cloudmail') {
serviceType = 'cloud_mail';
serviceType = 'cloudmail';
const domainInput = formData.get('cm_domain');
let domain = domainInput;
if (domainInput && domainInput.includes(',')) {
Expand Down Expand Up @@ -940,11 +940,9 @@ async function handleEditCustom(e) {
admin_email: formData.get('cm_admin_email'),
domain: domain
};
// 添加子域配置(如果有)
// 始终带上 subdomain,便于后端识别清空操作
const subdomain = formData.get('cm_subdomain');
if (subdomain && subdomain.trim()) {
config.subdomain = subdomain.trim();
}
config.subdomain = (subdomain || '').trim();
const pwd = formData.get('cm_admin_password');
if (pwd && pwd.trim()) config.admin_password = pwd.trim();
} else {
Expand Down