|
|
@@ -1,40 +1,40 @@
|
|
|
<template>
|
|
|
<div class="login-wrapper">
|
|
|
<div class="login-writh">
|
|
|
- <div class="login-padding">
|
|
|
- <div class="login-left">
|
|
|
- <img src="../../static/img/simple-img.jpg" alt="">
|
|
|
- </div>
|
|
|
- <div class="login-box">
|
|
|
- <div class="white-box">
|
|
|
- <h3 class="white-box-title">Welcome</h3><!--欢迎回来-->
|
|
|
- <el-form ref="form" :model="loginForm" label-width="80px">
|
|
|
- <el-form-item label-width="0px" class="border-bottom username">
|
|
|
- <el-input v-model="loginForm.userName" placeholder="UserName" @change="refreshLoginVerifyStatus"><!--账户-->
|
|
|
- <template slot="prepend"><!--<i class="el-icon-user"></i>--><i></i></template>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label-width="0px" class="border-bottom key-name">
|
|
|
- <el-input type="password" v-model="loginForm.password" auto-complete="off" placeholder="Password"><!--密码-->
|
|
|
- <template slot="prepend"><!--<i class="el-icon-lock"></i>--><i></i></template>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label-width="0px" class="border-bottom key-name" v-show="isLoginVerify">
|
|
|
- <el-input type="verifyCode" v-model="loginForm.verifyCode" auto-complete="off" @keyup.enter.native="onSubmit" placeholder="Captcha"><!--验证码-->
|
|
|
- <template slot="prepend"><i></i></template>
|
|
|
- </el-input>
|
|
|
- <el-image :src="captchaUrl" @click="changeCaptcha">
|
|
|
- </el-image>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label-width="0px" style="border-radius: 0">
|
|
|
- <el-button class="submit-button" type="primary" @click="onSubmit" :loading="submitButtonStat">Login</el-button><!--登录-->
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <div class="login-padding">
|
|
|
+ <div class="login-left">
|
|
|
+ <img src="../../static/img/simple-img.jpg" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="login-box">
|
|
|
+ <div class="white-box">
|
|
|
+ <h3 class="white-box-title">Welcome</h3><!--欢迎回来-->
|
|
|
+ <el-form ref="form" :model="loginForm" label-width="80px">
|
|
|
+ <el-form-item label-width="0px" class="border-bottom username">
|
|
|
+ <el-input v-model="loginForm.userName" placeholder="UserName" @change="refreshLoginVerifyStatus"><!--账户-->
|
|
|
+ <template slot="prepend"><!--<i class="el-icon-user"></i>--><i></i></template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width="0px" class="border-bottom key-name">
|
|
|
+ <el-input type="password" v-model="loginForm.password" auto-complete="off" placeholder="Password"><!--密码-->
|
|
|
+ <template slot="prepend"><!--<i class="el-icon-lock"></i>--><i></i></template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width="0px" class="border-bottom key-name" v-show="isLoginVerify">
|
|
|
+ <el-input type="verifyCode" v-model="loginForm.verifyCode" auto-complete="off" @keyup.enter.native="onSubmit" placeholder="Captcha"><!--验证码-->
|
|
|
+ <template slot="prepend"><i></i></template>
|
|
|
+ </el-input>
|
|
|
+ <el-image :src="captchaUrl" @click="changeCaptcha">
|
|
|
+ </el-image>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width="0px" style="border-radius: 0">
|
|
|
+ <el-button class="submit-button" type="primary" @click="onSubmit" :loading="submitButtonStat">Login</el-button><!--登录-->
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
@@ -61,9 +61,9 @@ export default {
|
|
|
verifyCode: '',
|
|
|
},
|
|
|
submitButtonStat: false,
|
|
|
- pageId:'',
|
|
|
+ pageId: '',
|
|
|
captchaUrl: '',
|
|
|
- isLoginVerify:false,
|
|
|
+ isLoginVerify: false,
|
|
|
}
|
|
|
},
|
|
|
beforeCreate () {
|
|
|
@@ -94,7 +94,7 @@ export default {
|
|
|
let pageId = this.pageId
|
|
|
if (baseInfo.daysDiff() === null) {
|
|
|
promise = network.getDaysDiff().then(response => {
|
|
|
- if( this.isLoginVerify ) {
|
|
|
+ if (this.isLoginVerify) {
|
|
|
let verifyCode = this.loginForm.verifyCode
|
|
|
let data = {
|
|
|
userName,
|
|
|
@@ -107,7 +107,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- if( this.isLoginVerify ) {
|
|
|
+ if (this.isLoginVerify) {
|
|
|
let verifyCode = this.loginForm.verifyCode
|
|
|
let data = {
|
|
|
userName,
|
|
|
@@ -115,7 +115,7 @@ export default {
|
|
|
verifyCode,
|
|
|
}
|
|
|
promise = network.loginGetAccessToken(userName, password, `oauth/login?page_id=${pageId}`, data)
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
promise = network.loginGetAccessToken(userName, password)
|
|
|
}
|
|
|
}
|
|
|
@@ -133,17 +133,17 @@ export default {
|
|
|
}).catch(error => {
|
|
|
console.log(error);
|
|
|
this.refreshLoginVerifyStatus();
|
|
|
- if( this.isLoginVerify ) {
|
|
|
+ if (this.isLoginVerify) {
|
|
|
this.changeCaptcha()
|
|
|
}
|
|
|
- if( error.message === 'ERROR_IS_MODIFY_PASSWORD' ) {
|
|
|
+ if (error.message === 'ERROR_IS_MODIFY_PASSWORD') {
|
|
|
// this.submitButtonStat = false
|
|
|
// console.log(this.loginForm.userName);
|
|
|
this.$router.push(`/modify-password/${this.loginForm.userName}`)
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
error = tool.errorHandle(error)
|
|
|
- this.$message.error(error.message)
|
|
|
- // this.submitButtonStat = false
|
|
|
+ this.$message.error(error.message)
|
|
|
+ // this.submitButtonStat = false
|
|
|
}
|
|
|
// error = tool.errorHandle(error)
|
|
|
// this.$message.error(error.message)
|
|
|
@@ -151,10 +151,10 @@ export default {
|
|
|
})
|
|
|
|
|
|
},
|
|
|
- changeCaptcha() {
|
|
|
+ changeCaptcha () {
|
|
|
this.captchaUrl = REQUEST_URL + 'site/captcha?page_id=' + this.pageId + '&v=' + Math.random();
|
|
|
},
|
|
|
- refreshLoginVerifyStatus() {
|
|
|
+ refreshLoginVerifyStatus () {
|
|
|
let path = 'oauth/is-login-verify'
|
|
|
axiosObj.post(path, {userName:this.loginForm.userName}).then(response => {
|
|
|
this.isLoginVerify = response === 1;
|
|
|
@@ -226,7 +226,7 @@ export default {
|
|
|
}
|
|
|
.el-input-group--prepend .el-input__inner, .el-input-group__append{border: none;background: none;border-radius: 0;width:94%;float: right;display: block; }
|
|
|
.border-bottom {border-bottom:2px #0c195d solid;}
|
|
|
- /*.el-input-group__append, .el-input-group__prepend{border: none;}*/
|
|
|
+ .el-input-group__append, .el-input-group__prepend{border: none;}
|
|
|
input:-webkit-autofill {
|
|
|
transition: background-color 5000s ease-in-out 0s;
|
|
|
}
|