From 4c7b7882b5f46be83e33641896d706098c7bdf8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=91=AB=E7=9D=BF?= Date: Thu, 26 Sep 2024 13:35:30 +0800 Subject: [PATCH] Validate model id --- frontend/src/components/endpoints/NewEndpoint.vue | 6 ++++++ frontend/src/components/finetune/NewFinetune.vue | 6 ++++++ frontend/src/locales/en_js/all.js | 1 + frontend/src/locales/zh_js/all.js | 1 + 4 files changed, 14 insertions(+) diff --git a/frontend/src/components/endpoints/NewEndpoint.vue b/frontend/src/components/endpoints/NewEndpoint.vue index b91bf94d2..b188640a1 100644 --- a/frontend/src/components/endpoints/NewEndpoint.vue +++ b/frontend/src/components/endpoints/NewEndpoint.vue @@ -269,6 +269,12 @@ { required: true, message: t('all.pleaseInput', { value: t('endpoints.new.modelId') }), + trigger: 'change' + }, + // 确保字符串中包含一个 /,但不能出现在首位或末尾 + { + pattern: /^(?!\/)[a-zA-Z0-9-_\.]+\/[a-zA-Z0-9-_\.]+(?