2. 前台传参到后台


  
方式一:参数直接跟在url后面(/queryModelList?name=1)
     
 
  var queryParams = new URLSearchParams();
       queryParams.append('runId', '1');

 

        this.$load.open({text:'加载中......'});
        executeUrl(queryParams).then(
            response => {
                this.$load.close();
                if(response.success){
                    this.$message({
                        type: 'success',
                        message: "执行成功"
                    });
                } else {
                    this.$message({
                        type: 'success',
                        message: "执行失败"
                    });
                }
                
            },
            response => {
                this.$message({
                    type: 'success',
                    message: "立即执行模型失败"
                });
            }
        );
 
 
方式二:json方式
 
  
  var queryParams = {
            runId: "1"
        }

        this.$load.open({text:'加载中......'});
        executeUrl(queryParams).then(
            response => {
                this.$load.close();
                if(response.success){
                    this.$message({
                        type: 'success',
                        message: "执行成功"
                    });
                } else {
                    this.$message({
                        type: 'success',
                        message: "执行失败"
                    });
                }
                
            },
            response => {
                this.$message({
                    type: 'success',
                    message: "执行失败"
                });
            }
        );
 
 
 
 

注意!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系我们删除。



 
粤ICP备14056181号  © 2014-2020 ITdaan.com