From f644c278c9293ec282140fb9433de1164187f6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E5=BC=BA?= <357099073@qq.com> Date: Wed, 2 Sep 2026 15:11:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/api/domain.js | 26 + backend/src/views/apps/cms/domain/audit.vue | 144 ++++- .../views/basicSettings/tenants/domain.vue | 378 +++++++++++-- docs/关于租户官网服务器端nginx的配置.md | 177 +++++- docs/自有域名绑定说明.md | 117 ++++ go/conf/app.conf | 23 +- go/controllers/acme_challenge.go | 35 ++ go/controllers/backend_domain.go | 172 +++++- go/controllers/domain_common.go | 280 ++++++++++ go/controllers/platform_domain.go | 116 +++- go/go.mod | 2 +- go/main.go | 5 +- go/models/system_tenant_domain.go | 50 +- go/routers/backend/backend.go | 3 + go/routers/platform/platform.go | 3 + go/routers/router.go | 5 + go/services/acme_cert.go | 528 ++++++++++++++++++ go/services/domain_verify.go | 159 ++++++ go/services/domain_verify_test.go | 321 +++++++++++ platform/src/api/domain.js | 26 + platform/src/views/apps/cms/domain/audit.vue | 144 ++++- .../views/basicSettings/tenants/domain.vue | 425 ++++++++++++-- sql/alter_tenant_domain_add_custom.sql | 39 ++ 23 files changed, 2966 insertions(+), 212 deletions(-) create mode 100644 docs/自有域名绑定说明.md create mode 100644 go/controllers/acme_challenge.go create mode 100644 go/services/acme_cert.go create mode 100644 go/services/domain_verify.go create mode 100644 go/services/domain_verify_test.go create mode 100644 sql/alter_tenant_domain_add_custom.sql diff --git a/backend/src/api/domain.js b/backend/src/api/domain.js index 1df1d21..87d5444 100644 --- a/backend/src/api/domain.js +++ b/backend/src/api/domain.js @@ -83,6 +83,32 @@ export function applyTenantDomain(data) { }) } +// 绑定自有域名(提交后需按提示配置解析,再调 checkCustomDns) +export function bindCustomDomain(data) { + return request({ + url: '/backend/domain/tenant/bindCustom', + method: 'post', + data + }) +} + +// 检测自有域名解析,通过后后端自动申请 HTTPS 证书 +export function checkCustomDomainDns(id) { + return request({ + url: '/backend/domain/tenant/checkCustomDns', + method: 'post', + data: { id } + }) +} + +// 获取自有域名解析配置指引(CNAME 目标 / A 记录 IP) +export function getCustomDomainGuide() { + return request({ + url: '/backend/domain/tenant/customDomainGuide', + method: 'get' + }) +} + // 审核租户域名 export function auditTenantDomain(data) { return request({ diff --git a/backend/src/views/apps/cms/domain/audit.vue b/backend/src/views/apps/cms/domain/audit.vue index b43b1a9..970b897 100644 --- a/backend/src/views/apps/cms/domain/audit.vue +++ b/backend/src/views/apps/cms/domain/audit.vue @@ -14,13 +14,17 @@