直接在请求回调函数里写,axios Supports the Promise API axios 一种方式: isLogin ({ commit }, { param }) { Vue.http.get(getUri('loginAPI', 'login'), { params: param }) .then( response => { const data = response.data let userParam = {} if( data.code){ this.dispatch('getUserInfoFn',{ //再次派发action userParam:data.number }) } }) .catch(response => {}) }, getUserInfoFn({commit},{userParam}){ Vue.http.get(url, { params: param }) .then( json => { const data = json.data }) .catch( json => {}) } 还有一种方式promise
直接在请求回调函数里写,axios Supports the Promise API axios
一种方式:
还有一种方式

promise