From 3cfab004f0fcb0c49f5fdfb6390ec20ef62bae6c Mon Sep 17 00:00:00 2001 From: jingrow Date: Mon, 4 Aug 2025 23:10:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E5=9C=A8=E6=B7=BB=E5=8A=A0=E6=88=96?= =?UTF-8?q?=E4=BF=AE=E6=94=B9MX=E5=92=8CSRV=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=97=B6=E6=98=BE=E7=A4=BA=E4=BC=98=E5=85=88?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src2/components/JsiteDomainDNSRecords.vue | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/dashboard/src2/components/JsiteDomainDNSRecords.vue b/dashboard/src2/components/JsiteDomainDNSRecords.vue index 2f707be..2db51f8 100644 --- a/dashboard/src2/components/JsiteDomainDNSRecords.vue +++ b/dashboard/src2/components/JsiteDomainDNSRecords.vue @@ -213,7 +213,7 @@ -
+
- {{ record.type === 'MX' && record.level ? record.level : '-' }} + {{ (record.type === 'MX' || record.type === 'SRV') && record.level ? record.level : '-' }}
@@ -470,7 +470,7 @@ export default { line: '', value: '', ttl: 600, - level: 10, + level: null, // 默认不设置优先级 editing: true, // 新增记录直接进入编辑模式 isNew: true }; @@ -500,8 +500,8 @@ export default { return; } - // 验证优先级 - if (record.level < 1 || record.level > 100) { + // 验证优先级 - 只在MX或SRV类型时验证 + if ((record.type === 'MX' || record.type === 'SRV') && (record.level < 1 || record.level > 100)) { toast.error('优先级必须在1~100之间'); return; } @@ -518,9 +518,12 @@ export default { host: record.item, value: record.value, ttl: record.ttl, - level: record.level, line: record.line }; + // 只在MX或SRV类型时添加level参数 + if (record.type === 'MX' || record.type === 'SRV') { + params.level = record.level; + } } else { // 修改记录 - 只传递可修改的字段 url = 'jcloud.api.domain_west.west_domain_modify_dns_record'; @@ -529,9 +532,12 @@ export default { record_id: record.id, value: record.value, ttl: record.ttl, - level: record.level, line: record.line }; + // 只在MX或SRV类型时添加level参数 + if (record.type === 'MX' || record.type === 'SRV') { + params.level = record.level; + } } const request = createResource({