New: The front-end prompts "The request JSON parameter format is incorrect, please check the parameter format."

Solution:

1. Check the backend console for errors:

The parameter format is transferred abnormally. The request number is: 3b44424d-73bd-4db7-970b-38638451c439. The specific information is: JSON parse error: Cannot deserialize value of type ` java.lang.Long` from String " New field ": not a valid Long value; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.lang.Long` from String " New Field ": not a valid Long value
 at [Source: ( PushbackInputStream); line: 1, column: 47] (through reference chain: com.xiaoxiao .ceshi["assetsId"])

Analysis: According to the error analysis, it is concluded that the Long type cannot be converted to String.

2. First check whether the field types in the entity class are consistent. First, try to add the @JsonSerialize (using = ToStringSerializer.class) annotation to the fields in the entity class . The function of this annotation is to convert the Long type to the String type.

3. If the above operation still cannot solve the problem, go to the front-end new page to print out whether the parameters passed by the front-end are correct.

 The console.log(values) here will print out the parameters passed from the front-end page to the back-end.

debug:

4. The assetsId parameter value printed on the front-end console is incorrect. The value passed should be a Long type value but what I passed is a String type value.

5. Find the value passed by assetsId on the front-end new page and change it to a suitable type.

Note: Since some pictures involve company projects, it is not convenient to display them!

Guess you like

Origin blog.csdn.net/m0_61464147/article/details/128221324