vue中vuex的actions里面请求接口,提交给mutations报错
// 请把代码文本粘贴到下方(请勿用图片代替代码)
actions.js
getCertificationStatus(context, vm){ return new Promise((resolve, reject) => { axios.post('/realNameUtils/gotoStatusPage') .then((res)=>{ context.commit('certificationStatus',res.data.content) }) }) } }
mutations.js
var state = { certificationStatus: null } const mutations = { getCertificationStatus(state,data){ state.certificationStatus = data }} export default{ state, mutations }
侃侃尔雅
婷婷同学_
相关分类