Browse Source

add text length limit

tianyunperfect 5 năm trước cách đây
mục cha
commit
56b363ac01
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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);