vue的get方法传参后台接收不到的问题
2019-25-18 12:25:36:639[http-nio-8081-exec-3]INFOcom.alibaba.druid.pool.DruidDataSource-{dataSource-1} inited2019-25-18 12:25:55:643[http-nio-8081-exec-5]INFOorg.apache.coyote.http11.Http11Proces...
2019-25-18 12:25:36:639[http-nio-8081-exec-3]INFO com.alibaba.druid.pool.DruidDataSource-{dataSource-1} inited
2019-25-18 12:25:55:643[http-nio-8081-exec-5]INFO org.apache.coyote.http11.Http11Processor-Error parsing HTTP request header
Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:479)
这个错是跨域问题,网上说是关于http头部的问题 让改成https 但是不适合我这个错
这个主要就是后端接收和前端的数据类型存在差距的原因
前端
let p2 = this.formInline.pName||undefined
axios({
url:'http://localhost:8081/product/searchnumcha',
method:'get',
params:{
pCate:p1,
pName:p2,
pPrice:p3,
pJianjie: p4,
},
}).then(({data})=>{
this.allpro = data;
console.log(this.tabledatel.pCate)
}
)
p2是个多选 是个数组类型
后端
@RequestParam(value = "pName") String name
这边需要是List 进行接收
否则就会出错 改成List name就行
更多推荐
所有评论(0)