axios第一次请求返回的数据再作为第二次请求的参数
created() {
const _this = this;
axios
.get("http://localhost:8181/invoice/findByNumber", {
params: { invoicecodeleft: this.$route.query.invoicecodeleft }
})
.then(function(resp) {
_this.formValidate = resp.data;
axios
.get("http://localhost:8181/merchants/findByNumber", {
params: { merchantnumber:resp.data.purchasernumber }
})
.then(function(resp1) {
_this.merchants1 = resp1.data;
});
});
},