From 773f880b120068badfb56d07dd0f295082f9a64c Mon Sep 17 00:00:00 2001 From: wangxi Date: Fri, 19 Dec 2025 16:23:49 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=B6=85=E8=BF=871w=20?= =?UTF-8?q?token=E7=9A=84=E6=8F=90=E7=A4=BA=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aicodecheck/GitlabToken/CreateToken.tsx | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/frontend/src/pages/aicodecheck/GitlabToken/CreateToken.tsx b/frontend/src/pages/aicodecheck/GitlabToken/CreateToken.tsx index fbd482e..be8227f 100644 --- a/frontend/src/pages/aicodecheck/GitlabToken/CreateToken.tsx +++ b/frontend/src/pages/aicodecheck/GitlabToken/CreateToken.tsx @@ -13,7 +13,7 @@ const { TextArea } = Input; const { Sider, Content } = Layout; const { Panel } = Collapse; -const MAX_PROMPT_LENGTH = 1000; +const MAX_PROMPT_LENGTH = 10000; // 禁用3天内的日期 const disabledDate = (current: dayjs.Dayjs) => { @@ -28,12 +28,12 @@ interface AIConfigPageProps { onSubmitLoading?: boolean; } -const AIConfigPage: React.FC = ({ - initialValues = {}, - visible = false, +const AIConfigPage: React.FC = ({ + initialValues = {}, + visible = false, setVisible, onSubmit: externalOnSubmit, - onSubmitLoading = false + onSubmitLoading = false }) => { const context = useContext(BasicContext) as any; const { i18nLocale } = context.storeContext; @@ -84,10 +84,10 @@ const AIConfigPage: React.FC = ({ message.error('自定义提示词最多1000字'); return; } - onSubmit({ - ...values, + onSubmit({ + ...values, comment_type: commentType, - prompt, + prompt, expired: values.expired?.unix(), status: 1 }, form); @@ -110,17 +110,17 @@ const AIConfigPage: React.FC = ({ .then((response) => { // form.resetFields(); message.success(values.id ? t('app.global.tip.update.success') : t('app.global.tip.create.success')); - + // 获取创建的 token ID,用于轮询 const tokenId = response.data?.id || updateData.id; - + // 跳转到GitlabToken列表页,带上轮询参数 if (tokenId) { navigate(`/aicodecheck/GitlabToken?pollingTokenId=${tokenId}`); } else { navigate('/aicodecheck/GitlabToken'); } - + setCreateSubmitLoading(false); }) .catch(() => { @@ -178,9 +178,9 @@ const AIConfigPage: React.FC = ({ } ]} > - @@ -248,7 +248,7 @@ const AIConfigPage: React.FC = ({