Request API in the actions of vuex in vue, which is submitted to mutations to report an error.

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

Mar.30,2021

var state = {
    certificationStatus: null
}
const mutations = {
    certificationStatus(state,data){
        state.certificationStatus = data
    }}
export default{
    state,
    mutations
}

try it like this.


by the way, actions submitted the method name in mutations, which I thought was the status name in mutations. I'm confused. Thank you


context.commit ('getCertificationStatus',res.data.content)

Menu