瀏覽代碼

add text length limit

tianyunperfect 5 年之前
父節點
當前提交
56b363ac01
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/pages/Memory/components/UpdateForm.tsx

+ 4 - 0
src/pages/Memory/components/UpdateForm.tsx

@@ -70,6 +70,10 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
         <Button
           type="primary"
           onClick={async () => {
+            if (formValues.front.length >= 3000 || formValues.back.length >= 3000) {
+              message.info("文字太长了,减少一些吧!");
+              return;
+            }
             let res;
             if (formValues.id != undefined) {
               res = await service.update(formValues);