The object returned by the back-end query list interface contains a Long id, and the front-end obtains this id, and executes the delete operation through the Long id. At this time, the delete operation reports an error 400, to the effect that the id of the Long type is not found.
Screenshot of swagger-related interfaces:
The Long type displayed in swagger is integer64, and integer is integer32.
This is the error message that appears in my backend console console after the front-end request.
The front-end part of the code is shown in the figure below:
Maybe the problem occurs in the parameter passing of the interface. Is the received parameter in urlencode encoding format or json encoding format?
At this time, I suddenly realized that maybe after the front end obtained a piece of data, it did not convert the corresponding field value type into json format when obtaining a certain field value of this data, but as an interface, it only recognizes the input json
format ginseng. This leads to the above error, no required value exists.
For example, if a piece of data of User
type , the is Long Id
taken out separately as an input parameter and passed to the interface. At this time, it needs to be Long Id
converted into Json format. It has to json.Stringfy(id)
be passed in in string format to convert it to json.
guide this package
The front end can try to qs.stringfiy
re json.Stringfy()
-encode the parameters with .