vue中deletet请求方式进行传参

let _this = this, queryParams = [];
                queryParams.push(_this.currentNodeId);
                _this.$refs['plantInfo'].validate((valid) => {
                    if (valid) {
                        _this.loading = true;
                        _this.$http.delete('/info/tprjinfo', {
                            data: queryParams
                        }).then(({data: res}) => {  
                            if (res.code !== 0) {
                                _this.loading = false;
                                return _this.$message.error(res.msg);
                            }
                            _this.$message({
                                message: '站点删除成功!',
                                type: "success",
                                duration: 500,
                                onClose: () => {
                                    _this.visible = false;
                                    _this.getAllSites();
                                },
                            });
                            _this.loading = false;
                        }).catch((error) => {
                            console.log(res)
                        });
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });

通过反复测试发现:delete请求的时候不能用params传参,而要用data

上一篇:vue封装页面全局加载子组件


下一篇:Centos7 Docker离线部署Mysql5.7