diff --git a/src/page/login/userlogin.vue b/src/page/login/userlogin.vue index e6ee475..1cbc859 100644 --- a/src/page/login/userlogin.vue +++ b/src/page/login/userlogin.vue @@ -1,48 +1,51 @@ @@ -87,7 +90,9 @@ export default { { min: 1, message: "密码长度最少为6位", trigger: "blur" } ] }, - passwordType: "password" + passwordType: "password", + proLoading: false, + loading: null, }; }, watch: { @@ -95,7 +100,18 @@ export default { }, created () { // this.getTenant(); - this.refreshCode(); + const {username, password} = this.$route.query + console.log(username, password) + if(username && password) { + this.proLoading = true + this.loginForm.username = username + this.loginForm.password = password + this.$nextTick(() => { + this.handleLogin() + }) + } else { + this.refreshCode(); + } }, mounted () { }, @@ -120,6 +136,24 @@ export default { : (this.passwordType = ""); }, handleLogin () { + if(this.proLoading) { + const loading = this.$loading({ + lock: true, + text: '登录中,请稍后。。。', + spinner: "el-icon-loading" + }); + this.$store.dispatch("LoginByUsername", { + ...this.loginForm, code: '0000' + }).then(() => { + this.$store.dispatch('jlHelpShow', false) + this.$router.push({ path: this.tagWel.value }); + loading.close(); + }).catch(() => { + loading.close(); + this.refreshCode(); + }); + return + } this.$refs.loginForm.validate(valid => { if (valid) { const loading = this.$loading({ @@ -156,4 +190,12 @@ export default {