//用户注册 async uerRegister({commit},user){ let result=await reqUserRegister(user); console.log(result) if (result.code==200) { return 'ok' } else { return Promise.reject(new Error('fail')); } }
//用户注册 async userRegister(){ const {phone,code,password,password1} =this; try { //如果成功路由跳转 password==password1 && phone &&code&&await this.$store.dispatch('uerRegister',{phone,code,password}) this.$router.push('/login') } catch (error) { alert(error.message) } }
标签:异步,调用,用户注册,处理,phone,code,result,&&,password From: https://www.cnblogs.com/xiaobaizitaibai/p/16996018.html