commit
This commit is contained in:
@@ -127,6 +127,18 @@
|
||||
color: black;
|
||||
}
|
||||
|
||||
.login-code{
|
||||
display: inline-block;
|
||||
float: right;
|
||||
width: 38%;
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.login-code img{
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
@@ -160,31 +172,49 @@
|
||||
<h4 class="login-content-title ml15">
|
||||
${AppName!}系统登录
|
||||
</h4>
|
||||
<el-tabs class="login-tabs">
|
||||
<!--<el-tab-pane label="用户名登录" name="1">
|
||||
<el-tabs class="login-tabs" v-model="activeName">
|
||||
<el-tab-pane label="用户名登录" name="1">
|
||||
<el-form v-if="activeName == '1'" :model="loginForm" :rules="loginRules" auto-complete="on" class="login-form"
|
||||
ref="loginForm">
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
placeholder="请输入用户名"
|
||||
placeholder="账号或手机号码"
|
||||
prefix-icon="el-icon-user"
|
||||
type="text"
|
||||
v-model="loginForm.username">
|
||||
v-model="loginForm.username"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
@keyup.enter.native="doLogin"
|
||||
placeholder="请输入密码"
|
||||
placeholder="密码"
|
||||
prefix-icon="el-icon-lock"
|
||||
type="password"
|
||||
v-model="loginForm.password">
|
||||
v-model="loginForm.password"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="platformCaptcha">
|
||||
<el-input
|
||||
@keyup.enter.native="doLogin"
|
||||
placeholder="验证码"
|
||||
prefix-icon="el-icon-lock"
|
||||
style="width: 60%"
|
||||
type="password"
|
||||
v-model="loginForm.platformCaptcha"
|
||||
>
|
||||
</el-input>
|
||||
<div class="login-code">
|
||||
<img :src="codeUrl" @click="getCodeUsername" alt="">
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button :disabled="disabled"
|
||||
:loading="loading"
|
||||
@click.native.prevent="handleLogin"
|
||||
@click.native.prevent="doLogin"
|
||||
class="login-button"
|
||||
type="primary">
|
||||
<span v-if="!loading">登 录</span>
|
||||
@@ -192,9 +222,9 @@
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>-->
|
||||
<el-tab-pane label="短信快捷登陆">
|
||||
<el-form :model="loginForm" :rules="loginRules" auto-complete="on" class="login-form"
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="短信快捷登陆" name="2">
|
||||
<el-form v-if="activeName == '2'" :model="loginForm" :rules="loginRules" auto-complete="on" class="login-form"
|
||||
ref="loginForm">
|
||||
<el-form-item prop="mobile">
|
||||
<el-input
|
||||
@@ -258,6 +288,7 @@
|
||||
timer: null,
|
||||
// 是否显示滑块验证
|
||||
isShowSliderVerify: false,
|
||||
activeName: '1',
|
||||
loginForm: {
|
||||
username: '',
|
||||
password: '',
|
||||
@@ -285,6 +316,7 @@
|
||||
},
|
||||
loading: false,
|
||||
disabled: false,
|
||||
codeUrl: "${base!}/platform/login/captcha",
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -389,7 +421,11 @@
|
||||
async doLogin() {
|
||||
const valid = await this.$refs['loginForm'].validate()
|
||||
if (valid) {
|
||||
this.loginForm.loginType = 'SMS_CODE'
|
||||
if (this.activeName === '2'){
|
||||
this.loginForm.loginType = 'SMS_CODE'
|
||||
} else {
|
||||
this.loginForm.loginType = null
|
||||
}
|
||||
const resp = await $.post('${base!}/platform/login/doLogin', this.loginForm)
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
@@ -408,26 +444,6 @@
|
||||
this.isShowSliderVerify = false;
|
||||
}
|
||||
}
|
||||
/*$.post(url, self.loginForm, function (d) {
|
||||
if (d.code == 0) {
|
||||
self.$refs.sliderVerify.verifySuccessEvent();
|
||||
self.$message({
|
||||
showClose: true,
|
||||
type: 'success',
|
||||
message: '登录成功,正在跳转首页...',
|
||||
duration: 1000
|
||||
});
|
||||
setTimeout(() => {
|
||||
window.location.href = "${base!}/platform/home"
|
||||
}, 500);
|
||||
} else {
|
||||
self.$message({
|
||||
message: d.msg,
|
||||
type: 'error'
|
||||
})
|
||||
self.isShowSliderVerify = false;
|
||||
}
|
||||
}, "json");*/
|
||||
},
|
||||
getQueryString(name) {
|
||||
const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
||||
@@ -451,10 +467,19 @@
|
||||
isMobile = true;
|
||||
}
|
||||
return isMobile;
|
||||
},
|
||||
|
||||
async getCodeUsername() {
|
||||
const {data} = await $.get('/platform/login/captcha')
|
||||
this.codeUrl = data.codeUrl
|
||||
this.loginForm.platformKey = data.key
|
||||
}
|
||||
},
|
||||
created() {
|
||||
async created() {
|
||||
this.year = new Date().getFullYear()
|
||||
if (this.activeName === '1'){
|
||||
await this.getCodeUsername()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('pageshow', (event) => {
|
||||
|
||||
Reference in New Issue
Block a user