概述
/*代码可用,暂时不用 const addsave1 = () => { axios({ method: 'post', url: BASE_URL + 'staff/create', data: { "number": state.addform.number, "name": state.addform.name, "sex": state.addform.sex, "nation": state.addform.nation, "company": state.addform.company, "dept": state.addform.dept, "job_name": state.addform.job_name, "job": state.addform.job, "job_level": state.addform.job_level, "birthday": state.addform.birthday, "education": state.addform.education, "degree": state.addform.degree, "professional": state.addform.professional, "work": state.addform.work, "party_number": state.addform.party_number, "people_grade": state.addform.people_grade, "phone": state.addform.phone, "work_experience": state.addform.work_experience }, headers: {'token': token} }).then(function (response) { console.log(response); console.log(response); if (response.data.code === 0) { console.log("保存成功"); state.addformvisible = false axios.get(BASE_URL + 'staff/getAll', {headers: {'token': token}}) .then(function (response) { console.log(response); if (response.data.code === 0) { console.log(response.data.data); state.list = response.data.data } else { console.log(response.data.msg); } }) .catch(function (error) { console.log(error); }) } else { console.log("保存失败"); alert("保存失败") } }); } */
最后
以上就是着急鸭子为你收集整理的axios原生发布post请求带token---最原生方法的全部内容,希望文章能够帮你解决axios原生发布post请求带token---最原生方法所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复