tuandm / laravue

Admin dashboard for enterprise Laravel applications built by VueJS and Element UI https://laravue.dev
https://laravue.dev
MIT License
2.21k stars 655 forks source link

Dispatch return undefined #325

Open justmealf opened 2 years ago

justmealf commented 2 years ago

Hi, i've try to get return value after dispatch login but always return undefined

handleLogin() { this.$refs.loginForm.validate(valid => { if (valid) { this.loading = true; csrf().then(() => { this.$store.dispatch('user/login', this.loginForm) .then((response) => { console.log(response); this.loading = false; }) .catch(() => { this.loading = false; }); }); } else { console.log('error submit!!'); return false; } }); },