先上代码
if(obj.event==='update'){
var index=layer.open({
title:'修改图书信息',//标题
type:2,
maxmin:true,
area:['100%','100%'],
content:[[@{/queryBookInfoById(id=data.id)}]]//这里content是一个URL
//content:'/queryBookInfoById?id='+data.id,
})//弹出层
报了400的错误
here was an unexpected error (type=Bad Request, status=400).
Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "data.id"
注释的那一行是可以运行的 但是使用内联的时候
id=data.id
无法将“java.lang.String”类型的值转换为所需的“java.lang.Integer”类型;嵌套异常是 java.lang.NumberFormatException
console给出最后解析的路径是queryBookInfoById?id=data.id
并没有获取到data.id的值
后 改成 content:[[@{/queryBookInfoById?id=}]]+data.id,
有点奇怪 但是可以执行
如果有正确的内联传参的方法 希望大佬可以告知一下 qaq