This commit is contained in:
parent
1c55e565b4
commit
188876e18f
|
|
@ -1,144 +1,227 @@
|
||||||
<template>
|
<template>
|
||||||
|
<div class="site-wrapper site-page--login">
|
||||||
</template>
|
<div class="site-content__wrapper" >
|
||||||
|
<div class="site-content">
|
||||||
<script>
|
<div class="brand-info">
|
||||||
import { userLogin, getVerCode } from "@/api/getdata";
|
<h2 class="brand-info__text">智慧后勤服务平台1</h2>
|
||||||
import { setToken } from '@/utils/auth'
|
<p class="brand-info__intro"></p>
|
||||||
import CryptoJS from 'crypto-js'
|
</div>
|
||||||
var KEY = CryptoJS.enc.Utf8.parse("greenh5java12345");
|
<div class="login-main" :element-loading-text="loadingMsg" v-loading="loading">
|
||||||
var IV = CryptoJS.enc.Utf8.parse("greenh5java12345");
|
<h3 class="login-title">登录</h3>
|
||||||
export default {
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" status-icon>
|
||||||
data() {
|
<el-form-item prop="userName">
|
||||||
return {
|
<el-input v-model="dataForm.userName" placeholder="帐号"></el-input>
|
||||||
dataForm: {
|
</el-form-item>
|
||||||
userName: '',
|
<el-form-item prop="password">
|
||||||
password: '',
|
<el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
|
||||||
uuid: '',
|
</el-form-item>
|
||||||
captcha: '',
|
<el-form-item prop="verCode">
|
||||||
verCode: "",
|
<el-input style="width:60%!important;float:left" v-model="dataForm.verCode" placeholder="验证码"></el-input>
|
||||||
codeId: ""
|
<img @click="getVerCode()" :src="codeImg" width="100" height="40" class="head_pic" style="float:right" />
|
||||||
},
|
</el-form-item>
|
||||||
dataRule: {
|
<el-form-item>
|
||||||
userName: [
|
<el-button class="login-btn-submit" type="primary" @click="dataFormSubmit()">登录</el-button>
|
||||||
{ required: true, message: '帐号不能为空', trigger: 'blur' }
|
</el-form-item>
|
||||||
],
|
</el-form>
|
||||||
password: [
|
</div>
|
||||||
{ required: true, message: '密码不能为空', trigger: 'blur' }
|
</div>
|
||||||
],
|
</div>
|
||||||
verCode: [
|
</div>
|
||||||
{ required: true, message: '验证码不能为空', trigger: 'blur' }
|
</template>
|
||||||
]
|
|
||||||
},
|
<script>
|
||||||
captchaPath: '',
|
import { userLogin,getVerCode } from "@/api/getdata";
|
||||||
loading: false, //初始化loading
|
import { setToken } from '@/utils/auth'
|
||||||
loadingMsg: "",
|
import CryptoJS from 'crypto-js'
|
||||||
codeImg: "",
|
var KEY = CryptoJS.enc.Utf8.parse("greenh5java12345");
|
||||||
codeId: ""
|
var IV = CryptoJS.enc.Utf8.parse("greenh5java12345");
|
||||||
}
|
export default {
|
||||||
},
|
data() {
|
||||||
created() {
|
return {
|
||||||
this.getVerCode();
|
dataForm: {
|
||||||
},
|
userName: '',
|
||||||
methods: {
|
password: '',
|
||||||
getVerCode() {
|
uuid: '',
|
||||||
let logUrl = "http://10.224.64.4:27000/greenH5/greenWebmodul/dist/index.html?#/ywgllogin";
|
captcha: '',
|
||||||
let isc_login = "http://iscsso.cc.sgcc.com.cn:17011/isc_sso/login?service=";
|
verCode:"",
|
||||||
window.location.href = isc_login + logUrl;
|
codeId:""
|
||||||
|
},
|
||||||
|
dataRule: {
|
||||||
|
userName: [
|
||||||
|
{ required: true, message: '帐号不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
password: [
|
||||||
|
{ required: true, message: '密码不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
verCode: [
|
||||||
|
{ required: true, message: '验证码不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
captchaPath: '',
|
||||||
|
loading: false, //初始化loading
|
||||||
|
loadingMsg: "",
|
||||||
|
codeImg:"",
|
||||||
|
codeId:""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
created(){
|
||||||
}
|
this.getVerCode();
|
||||||
</script>
|
},
|
||||||
|
methods: {
|
||||||
<style lang="scss">
|
createLoad() {
|
||||||
.site-wrapper.site-page--login {
|
this.loading = true;
|
||||||
position: absolute;
|
this.loadingMsg = "登录中...";
|
||||||
top: 0;
|
},
|
||||||
right: 0;
|
clearLoad() {
|
||||||
bottom: 0;
|
this.loading = false;
|
||||||
left: 0;
|
this.loadingMsg = "";
|
||||||
background-color: rgba(38, 50, 56, .6);
|
},
|
||||||
overflow: hidden;
|
getVerCode(){
|
||||||
|
getVerCode({})
|
||||||
&:before {
|
.then(res => {
|
||||||
position: fixed;
|
if (res.returnCode == "1") {
|
||||||
top: 0;
|
this.clearLoad();
|
||||||
left: 0;
|
console.log(res);
|
||||||
z-index: -1;
|
this.codeImg ="data:image/jpeg;base64,"+ res.returnData.imgBase64;
|
||||||
width: 100%;
|
this.dataForm.codeId = res.returnData.imgUUID
|
||||||
height: 100%;
|
} else {
|
||||||
content: "";
|
setTimeout(() => {
|
||||||
background-image: url(~@/assets/images/login_bg.jpg);
|
this.clearLoad();
|
||||||
background-size: cover;
|
}, 300);
|
||||||
}
|
}
|
||||||
|
})
|
||||||
.site-content__wrapper {
|
.catch(err => {
|
||||||
position: absolute;
|
console.log(err);
|
||||||
top: 0;
|
setTimeout(() => {
|
||||||
right: 0;
|
this.clearLoad();
|
||||||
bottom: 0;
|
}, 300);
|
||||||
left: 0;
|
});
|
||||||
padding: 0;
|
},
|
||||||
margin: 0;
|
|
||||||
overflow-x: hidden;
|
// 提交表单
|
||||||
overflow-y: auto;
|
dataFormSubmit () {
|
||||||
background-color: transparent;
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
}
|
if (valid) {
|
||||||
|
this.createLoad();
|
||||||
.site-content {
|
var userPossword = CryptoJS.AES.encrypt(this.dataForm.password, KEY, {
|
||||||
min-height: 100%;
|
iv: IV, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.ZeroPadding
|
||||||
padding: 30px 500px 30px 30px;
|
}).toString();
|
||||||
}
|
|
||||||
|
let Content = {
|
||||||
.brand-info {
|
'loginName': this.dataForm.userName,
|
||||||
margin: 220px 100px 0 90px;
|
'userPossword': userPossword,
|
||||||
color: #fff;
|
'verCode' :this.dataForm.verCode,
|
||||||
}
|
'codeId' :this.dataForm.codeId
|
||||||
|
|
||||||
.brand-info__text {
|
};
|
||||||
margin: 0 0 22px 0;
|
userLogin(Content)
|
||||||
font-size: 48px;
|
.then(res => {
|
||||||
font-weight: 400;
|
if (res.returnCode == "1") {
|
||||||
/*text-transform : uppercase;*/
|
this.clearLoad();
|
||||||
}
|
setToken(res.returnData.token);
|
||||||
|
this.$router.replace({ name: 'home' })
|
||||||
.brand-info__intro {
|
} else {
|
||||||
margin: 10px 0;
|
this.getVerCode();
|
||||||
font-size: 16px;
|
this.$message({
|
||||||
line-height: 1.58;
|
message: res.returnMsg,
|
||||||
opacity: .6;
|
type: "warning"
|
||||||
}
|
});
|
||||||
|
setTimeout(() => {
|
||||||
.login-main {
|
this.clearLoad();
|
||||||
position: absolute;
|
}, 300);
|
||||||
top: 0;
|
}
|
||||||
right: 0;
|
})
|
||||||
padding: 150px 60px 180px;
|
.catch(err => {
|
||||||
width: 470px;
|
console.log(err);
|
||||||
min-height: 100%;
|
setTimeout(() => {
|
||||||
background-color: #fff;
|
this.clearLoad();
|
||||||
}
|
}, 300);
|
||||||
|
});
|
||||||
.login-title {
|
}
|
||||||
font-size: 16px;
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-captcha {
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
>img {
|
|
||||||
width: 100%;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
</script>
|
||||||
.login-btn-submit {
|
|
||||||
width: 100%;
|
<style lang="scss">
|
||||||
margin-top: 38px;
|
.site-wrapper.site-page--login {
|
||||||
}
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
.el-input {
|
right: 0;
|
||||||
width: 100% !important;
|
bottom: 0;
|
||||||
}
|
left: 0;
|
||||||
}
|
background-color: rgba(38, 50, 56, .6);
|
||||||
</style>
|
overflow: hidden;
|
||||||
|
&:before {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: -1;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
content: "";
|
||||||
|
background-image: url(~@/assets/images/login_bg.jpg);
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
.site-content__wrapper {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
.site-content {
|
||||||
|
min-height: 100%;
|
||||||
|
padding: 30px 500px 30px 30px;
|
||||||
|
}
|
||||||
|
.brand-info {
|
||||||
|
margin: 220px 100px 0 90px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.brand-info__text {
|
||||||
|
margin: 0 0 22px 0;
|
||||||
|
font-size: 48px;
|
||||||
|
font-weight: 400;
|
||||||
|
/*text-transform : uppercase;*/
|
||||||
|
}
|
||||||
|
.brand-info__intro {
|
||||||
|
margin: 10px 0;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1.58;
|
||||||
|
opacity: .6;
|
||||||
|
}
|
||||||
|
.login-main {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
padding: 150px 60px 180px;
|
||||||
|
width: 470px;
|
||||||
|
min-height: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
.login-title {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
.login-captcha {
|
||||||
|
overflow: hidden;
|
||||||
|
> img {
|
||||||
|
width: 100%;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.login-btn-submit {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 38px;
|
||||||
|
}
|
||||||
|
.el-input {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
Loading…
Reference in New Issue