Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
453 views
in Technique[技术] by (71.8m points)

vue 方法互相调用,被调用方法后台无法获取参数。

     insertTender(){
        axios.post('/index/insertTender').then((res) =>{
         this.getTableData();
        })
    },
    getTableData(){//获取表格数据
        axios.post('/index/getData',
             this.qs.stringify({
               page:this.pageInfo.currentPage,
               rows:10,
             }),
          ).then((res) => 
            })
        }

后端:

 PrintWriter writer =  response.getWriter();
      String result = null;
      String page = request.getParameter("page");
      String rows = request.getParameter("rows")!=null?request.getParameter("rows"):"";
      System.out.println(page);
      System.out.println(rows);

补充NewWork:

image.png

补充服务器参数输出:
image.png

我是在insertTender()执行成功之后,执行getTableData()
page和rows 偶然会获取不到参数,概率在五分之一
如果我把getTableData()单独执行就不会出现获取不到参数的情况
这个问题困扰我很久了,希望有大佬解惑


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

network看下你的传参是否正确。我看你还stringify了,你是post了一个字符串?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...