后臺單個列表,點擊刪除按鈕之后調(diào)用webman寫的接口,delete請求方式,然后接口返回成功,成功后前端新請求列表接口并刷新列表,請求的列表接口報 400 Bad Request
// 刪除模版
deleteTemp(item) {
this.$confirm('此操作將刪除該模版, 是否繼續(xù)?', '提示', {
confirmButtonText: '確定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http.delete(`/api/report/template/${item.template_no}`).then(
response => {
let res = response.body;
if (res.error_code === 0) {
this.isLoading = false;
this.$notify({
title: "刪除成功",
message: res.message,
type: "success",
duration: 1000
});
this.onChangePage();
} else {
this.isLoading = false;
this.$notify({
title: "提示",
message: res.message,
type: "warning",
duration: 1000
});
}
},
response => {
response &&
this.$notify({
title: "提示",
message: response,
type: "error",
duration: 1000
});
}
);
}).catch((err) => {});
},
在onChangePage方法中會調(diào)用列表接口, 使用的 this.$http.post 接口返回了400
400 Bad Request
發(fā)現(xiàn)把刪除的接口換成非delete(如使用post或者get)之后就沒問題了,但delete之后的請求會400,但刷新單獨請求列表就能正常響應(yīng)。把delete請求發(fā)送到其他服務(wù)上驗證,也是沒有問題的。
正常的返回:
openresty/1.21.4.1
Webman-framework v1.4.7
PHP 7.4.30