1 前端传过来的数据,和后端不一致时,会出现如下问题
Failed to bind request element: org.springframework.web.method.annotation.MethodArgumentTypeMismatchException:
Failed to convert value of type [java.lang.String] to required type [java.lang.Integer]; nested exception is java.lang.NumberFormatException: For input string: "admin"
[nio-8089-exec-5] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type [java.lang.String] to required type [java.lang.Integer]; nested exception is java.lang.NumberFormatException: For input string: "admin"
解决办法,就是使前后端数据类型一直就可以了。
还有一种就是转换
连接如下
https://blog.csdn.net/gwd1154978352/article/details/75041733