Explorar el Código

add text length limit

tianyunperfect hace 5 años
padre
commit
56b363ac01
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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);