flat: 123
This commit is contained in:
@@ -1,48 +1,51 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="login-title">{{ $t('login.phoneLogin') }}</div>
|
||||
<el-form :model="loginForm" :rules="loginRules" ref="loginForm" class="login-form">
|
||||
<el-form-item prop="username">
|
||||
<el-input size="small" style="margin-top: 20px; margin-bottom:10px;"
|
||||
@keyup.enter.native="handleLogin"
|
||||
v-model="loginForm.username"
|
||||
:auto-complete="off"
|
||||
placeholder="请输入您的账号">
|
||||
<i slot="prefix" class="icon-yonghu" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input size="small" style="margin-top: 20px; margin-bottom:10px;"
|
||||
type="password"
|
||||
@keyup.enter.native="handleLogin"
|
||||
v-model="loginForm.password"
|
||||
:auto-complete="off"
|
||||
placeholder="请输入您的密码">
|
||||
<i slot="prefix" class="icon-mima"/>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="this.website.captchaMode" prop="code">
|
||||
<el-input size="small" style="margin-top: 20px; margin-bottom:10px;"
|
||||
@keyup.enter.native="handleLogin"
|
||||
v-model="loginForm.code"
|
||||
auto-complete="off"
|
||||
placeholder="请输入图形验证码"
|
||||
class="code-input">
|
||||
<i slot="prefix" class="icon-yanzhengma"/>
|
||||
</el-input>
|
||||
<div class="login-code" >
|
||||
<img :src="loginForm.image" class="login-code-img" @click="refreshCode" />
|
||||
<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">
|
||||
<el-input size="small" style="margin-top: 20px; margin-bottom:10px;"
|
||||
@keyup.enter.native="handleLogin"
|
||||
v-model="loginForm.username"
|
||||
:auto-complete="off"
|
||||
placeholder="请输入您的账号">
|
||||
<i slot="prefix" class="icon-yonghu" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input size="small" style="margin-top: 20px; margin-bottom:10px;"
|
||||
type="password"
|
||||
@keyup.enter.native="handleLogin"
|
||||
v-model="loginForm.password"
|
||||
:auto-complete="off"
|
||||
placeholder="请输入您的密码">
|
||||
<i slot="prefix" class="icon-mima"/>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="this.website.captchaMode" prop="code">
|
||||
<el-input size="small" style="margin-top: 20px; margin-bottom:10px;"
|
||||
@keyup.enter.native="handleLogin"
|
||||
v-model="loginForm.code"
|
||||
auto-complete="off"
|
||||
placeholder="请输入图形验证码"
|
||||
class="code-input">
|
||||
<i slot="prefix" class="icon-yanzhengma"/>
|
||||
</el-input>
|
||||
<div class="login-code" >
|
||||
<img :src="loginForm.image" class="login-code-img" @click="refreshCode" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<div>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click.native.prevent="handleLogin"
|
||||
class="login-submit"
|
||||
>{{$t('login.submit')}}</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<div>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click.native.prevent="handleLogin"
|
||||
class="login-submit"
|
||||
>{{$t('login.submit')}}</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
<style lang="scss">
|
||||
@import "@/styles/login.scss";
|
||||
.proLoading-box{
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user