put、delete、post、get四种传参方式

PUT:

 this.$http.put('/v2x/vrsifromuserlog', {
              modifyTime:this.sizeForm.modifyTime,
              mqttRes:this.sizeForm.mqttRes,
              udpRes:this.sizeForm.udpRes,
              refId:this.sizeForm.refId,
              id:this.sizeForm.id
            } ).then

POST:

 this.$http.post('/v2x/vrsifromuserlog', {
          createTime:time,
          mqttRes:this.sizeForm.mqttRes,
          udpRes:this.sizeForm.udpRes,
          refId:this.sizeForm.refId,
          deleteFlag:this.sizeForm.deleteFlag
        } )

DELETE:

  deleteMany() {
        let param = this.multipleSelection;
        if(param.length != 0){
          this.$confirm('此操作将批量删除选中的文件, 是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            this.$http.delete('/v2x/vrsifromuserlog/',{data: param}).then(res=>{
              if(res.data.code==0){
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                });
              }
              else{
                this.$message({
                  type: 'failed',
                  message: '删除失败!'
                });
              }
              this.load()
            });
          }).catch(() => {
            this.$message({
              type: 'info',
              message: '已取消删除'
            });
          });
        }
        else{
          this.$alert('请选择需要删除的数据', '批量删除', {
            confirmButtonText: '确定',
          })
        }
      },

POST:

  this.$http.post('/v2x/vrsifromuserlog', {
          createTime:time,
          mqttRes:this.sizeForm.mqttRes,
          udpRes:this.sizeForm.udpRes,
          refId:this.sizeForm.refId,
          deleteFlag:this.sizeForm.deleteFlag
        } )

猜你喜欢

转载自www.cnblogs.com/hy96/p/12132236.html