problem description
request API in actions of vuex in vue, which is submitted to mutations for error
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)
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
}
what result do you expect? What is the error message actually seen?
error