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