2. 前台传参到后台

Posted on 2019-02-18 19:01  zkx4213  阅读(248)  评论(0编辑  收藏  举报
  
方式一:参数直接跟在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: "执行失败"
                });
            }
        );
 
 
 
 

Copyright © 2024 zkx4213
Powered by .NET 9.0 on Kubernetes