首页 > 其他分享 >vuejs 前端 使用axios发送get、post请求 参数在query和body里面的各种情况

vuejs 前端 使用axios发送get、post请求 参数在query和body里面的各种情况

时间:2022-11-04 15:55:33浏览次数:35  
标签:body 发送 axios get project query post

使用axios发送get请求,参数写在query里

    let res = await this.$axios.get('/user/b/getOrgList', {
        params: {
            pageNo: 1,
            pageSize: 99,
            type: 6
        }
    })
    this.researchList = res.data.retData.list
},

使用axios发送post请求,参数写在body里

async AddOrModifyIt() {
await this.$axios.post('/project/b/project/updateProjectOrg', {
leader: this.leader,
oldOrgId: this.orgPrimaryId,
planSubjectNum: this.planSubjectNum,
sectionId: this.mainResearchValue.sectionId,
userId: this.mainResearchValue.userId,
userName: this.mainResearchValue.name
})
},

使用axios发送post请求,参数写在query里

async deleteRow(index, row) {
await this.$axios.post(
'/project/b/project/deleteProjectOrgById',
{},
{
params: {
orgPrimaryId: this.orgPrimaryId
}
}
)
},

标签:body,发送,axios,get,project,query,post
From: https://www.cnblogs.com/mdtayz/p/16858101.html

相关文章