|
@@ -109,21 +109,24 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleLogin() {
|
|
|
- this.$refs.loginForm.validate(valid => {
|
|
|
- if (valid) {
|
|
|
- this.loading = true
|
|
|
- this.$store.dispatch('user/login', this.loginForm).then(() => {
|
|
|
- /* this.initSystemInfo() */
|
|
|
- this.$router.push({ path: this.redirect || '/' })
|
|
|
- this.loading = false
|
|
|
- }).catch(() => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
- } else {
|
|
|
- console.log('error submit!!')
|
|
|
- return false
|
|
|
- }
|
|
|
- })
|
|
|
+ if (!this.loading) {
|
|
|
+ this.$refs.loginForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true
|
|
|
+ this.$store.dispatch('user/login', this.loginForm).then(() => {
|
|
|
+ /* this.initSystemInfo() */
|
|
|
+ this.$router.push({ path: this.redirect || '/' })
|
|
|
+ this.loading = false
|
|
|
+ }).catch(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false
|
|
|
+ }, 3 * 1000)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|