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

Logo

前往低代码交流专区

更多推荐