vue get传参后台接收不到
2020-06-08 本文已影响0人
王芊芊
我是这么写的:封装的接口中打印data正常显示

但是接口看不到参数,成功返回的信息是空

参考上面文章将data改为params即可

普通ajax,可以直接通过data传参,后台接受,是没问题的;vue如果也是用data传参,就不行了,因为vue在ajax的基础上又进行了封装,如果非要传data格式的数据,则需要后台将接受类型@RequestParam 改为 @RequestBody 或者在vue中将vue中的传参类型data改为params