|
|
@@ -349,6 +349,9 @@ export default {
|
|
|
this.$message.warning('请先完成滑动验证')
|
|
|
return
|
|
|
}
|
|
|
+ if (this.loading) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$refs.loginForm.validate(async (valid) => {
|
|
|
if (!valid) return
|
|
|
this.loading = true
|
|
|
@@ -366,9 +369,14 @@ export default {
|
|
|
localStorage.setItem('roles', JSON.stringify(roles))
|
|
|
this.$message.success('登录成功')
|
|
|
await this.$nextTick()
|
|
|
- this.$router.push({ path: '/' })
|
|
|
+ this.$router.replace({ path: '/' })
|
|
|
} catch (e) {
|
|
|
- this.$message.error(e.message || '登录失败,请检查账号密码')
|
|
|
+ const msg = e && e.message ? e.message : '登录失败,请检查账号密码'
|
|
|
+ if (this.$message) {
|
|
|
+ this.$message.error(msg)
|
|
|
+ } else {
|
|
|
+ console.error(msg)
|
|
|
+ }
|
|
|
this.resetCaptcha()
|
|
|
} finally {
|
|
|
this.loading = false
|