flat: 123
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<div class="proLoading-box" v-if="proLoading"></div>
|
||||||
|
<div v-else>
|
||||||
<div class="login-title">{{ $t('login.phoneLogin') }}</div>
|
<div class="login-title">{{ $t('login.phoneLogin') }}</div>
|
||||||
<el-form :model="loginForm" :rules="loginRules" ref="loginForm" class="login-form">
|
<el-form :model="loginForm" :rules="loginRules" ref="loginForm" class="login-form">
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
@@ -44,6 +46,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -87,7 +90,9 @@ export default {
|
|||||||
{ min: 1, message: "密码长度最少为6位", trigger: "blur" }
|
{ min: 1, message: "密码长度最少为6位", trigger: "blur" }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
passwordType: "password"
|
passwordType: "password",
|
||||||
|
proLoading: false,
|
||||||
|
loading: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -95,7 +100,18 @@ export default {
|
|||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
// this.getTenant();
|
// this.getTenant();
|
||||||
|
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();
|
this.refreshCode();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
},
|
},
|
||||||
@@ -120,6 +136,24 @@ export default {
|
|||||||
: (this.passwordType = "");
|
: (this.passwordType = "");
|
||||||
},
|
},
|
||||||
handleLogin () {
|
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 => {
|
this.$refs.loginForm.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const loading = this.$loading({
|
const loading = this.$loading({
|
||||||
@@ -156,4 +190,12 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "@/styles/login.scss";
|
@import "@/styles/login.scss";
|
||||||
|
.proLoading-box{
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: #FFFFFF;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user