flat: 123

This commit is contained in:
Apcallover
2024-03-19 22:45:16 +08:00
parent 37168fa083
commit 8aa0db2fd3

View File

@@ -1,5 +1,7 @@
<template>
<div>
<div class="proLoading-box" v-if="proLoading"></div>
<div v-else>
<div class="login-title">{{ $t('login.phoneLogin') }}</div>
<el-form :model="loginForm" :rules="loginRules" ref="loginForm" class="login-form">
<el-form-item prop="username">
@@ -44,6 +46,7 @@
</div>
</el-form>
</div>
</div>
</template>
<script>
@@ -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();
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 {
<style lang="scss">
@import "@/styles/login.scss";
.proLoading-box{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: #FFFFFF;
}
</style>