From 6fa4caa85e5da0d23972f6ff551c8122bb6f8adb Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 20 Jul 2025 12:34:22 +0800 Subject: [PATCH] fix https://github.com/jxxghp/MoviePilot/issues/4635 --- src/components/cards/CustomRuleCard.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/components/cards/CustomRuleCard.vue b/src/components/cards/CustomRuleCard.vue index c8c11c2c..1d0b3397 100644 --- a/src/components/cards/CustomRuleCard.vue +++ b/src/components/cards/CustomRuleCard.vue @@ -87,6 +87,12 @@ function saveRuleInfo() { emit('done') } +// 验证规则ID输入 +function validateRuleId() { + // 只允许英文和数字,不允许空格 + ruleInfo.value.id = ruleInfo.value.id.replace(/[^a-zA-Z0-9]/g, '') +} + // 按钮点击 function onClose() { emit('close') @@ -138,6 +144,7 @@ function onClose() { persistent-hint active prepend-inner-icon="mdi-identifier" + @input="validateRuleId" />