Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: "${id}"]
报错信息显示:不能将类型为 'java.lang.String' 的值转换为所需类型‘int’;嵌套的异常为java.lang.NumberFormatException: 对于输入字符串: "${id}"
我在前端写了添加和修改按钮,对应vue中的方法openEditUI(),在测试修改按钮时,反复输入都是进入新增分支。查看前端请求地址为:http://localhost:8080/role/$%7Bid%7d 显然是id解析错误。
然后到manager.js中查看对应方法的url 。发现是引号错误,我们需要从请求路径中传值的时候要用Esc下边的单引符号,成功解决