diff --git a/src/components/article/edit-modal.tsx b/src/components/article/edit-modal.tsx index 2bf5c65..5861004 100644 --- a/src/components/article/edit-modal.tsx +++ b/src/components/article/edit-modal.tsx @@ -140,6 +140,11 @@ export default function ArticleEditModal(props: Props) { // setState({msgTitle: '请输入标题内容'}); return; } + if(i18n.language == 'zh-CN' && tag.length > 4 ){ + // 获取图文设置不正确的数据 + setState({ msgGroup: t('news.edit.tag_length_error') }); + return; + } if (groups.length == 0 || groups[0].length == 0 || !groups[0][0].content) { setState({ msgGroup: t('news.edit_empty_human_content') }); return; @@ -180,6 +185,11 @@ export default function ArticleEditModal(props: Props) { // setState({msgTitle: '请输入标题内容'}); return; } + if(i18n.language == 'zh-CN' && tag.length > 4 ){ + // 获取图文设置不正确的数据 + setState({ msgGroup: t('news.edit.tag_length_error') }); + return; + } if (groups.length == 0 || groups[0].length == 0 || !groups[0][0].content) { setState({ msgGroup: t('news.edit_empty_human_content') }); return; @@ -307,7 +317,7 @@ export default function ArticleEditModal(props: Props) { key={idx} placement="bottomLeft" arrow={false} content={} > - 背景{idx + 1} + {t('news.edit.bg')}{idx + 1} ))} diff --git a/src/i18n/translations/en-US.json b/src/i18n/translations/en-US.json index 7c8be31..f068bd3 100644 --- a/src/i18n/translations/en-US.json +++ b/src/i18n/translations/en-US.json @@ -96,6 +96,7 @@ "edit": { "bg": "Background", "tag": "Tag", + "tag_length_error": "Video tag only limit 4 words ", "tag_placeholder": "Example: Enterprise dynamics" }, "edit_add_group": "Add Group", diff --git a/src/i18n/translations/zh-CN.json b/src/i18n/translations/zh-CN.json index fc60d7e..7d43651 100644 --- a/src/i18n/translations/zh-CN.json +++ b/src/i18n/translations/zh-CN.json @@ -96,6 +96,7 @@ "edit": { "bg": "背景", "tag": "标签", + "tag_length_error": "标签长度不能超过4个字", "tag_placeholder": "例:企业动态" }, "edit_add_group": "新增分组",