先看问题
![](https://i-blog.csdnimg.cn/blog_migrate/d6f27aca24d056c64f15c872f3bd418c.png)
![](https://i-blog.csdnimg.cn/blog_migrate/b0c759bf6ce5691312a6a13c7b5a04d5.png)
这里实用的都是put请求,但是点击修改按钮却提示不支持get请求
有的大佬说是http转到https重定向出现的问题,有的哥们说是method拼错了,但是第一种我不懂,第二种我检查了不是。。
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id
getBook(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改图书";
});
},
这是修改案件绑定的事件,让我们简单修改一下
3.修改后如下,这样我们就知道是哪一行出了问题
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
alert("66666");
const id = row.id
alert("77777");
getBook(id).then(response => {
alert("88888");
this.form = response.data;
this.open = true;
this.title = "修改图书";
});
},
4.检查得知是这一行出了问题
![](https://i-blog.csdnimg.cn/blog_migrate/5cd1ebd6df6410f1ecb4cb130b92613b.png)
5.推断大概率是getBook出了问题,因为它用的是get请求,找到的时候是这样的,可能是上面的/被我误删了,导致下面的代码出现了问题
![](https://i-blog.csdnimg.cn/blog_migrate/43d8b4da77e2cccde5d5074ec646c744.png)
6.修改后
/**
* 获取图书
* 详细信息
*= 123*/
@PreAuthorize("@ss.hasPermi('system:book:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(bmBookService.selectBmBookById(id));
}
修改好了就可以了
一开始我以为是put请求被浏览器改成了get请求,搞了半天,因为检查网络里的请求也是get,被误导了。