首页 > 移动平台 > 详细

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

时间:2021-03-12 18:46:07      阅读:1162      评论:0      收藏:0      [点我收藏+]

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

async getOrgList() {
        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
                }
            }
        )
    },

 

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

原文:https://www.cnblogs.com/ysx215/p/14525127.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!