|
|
@@ -1,89 +1,128 @@
|
|
|
<template>
|
|
|
<div class="login-container">
|
|
|
- <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
|
|
|
-
|
|
|
- <div class="title-container">
|
|
|
- <h3 class="title">Login Form</h3>
|
|
|
- </div>
|
|
|
-
|
|
|
- <el-form-item prop="username">
|
|
|
- <span class="svg-container">
|
|
|
- <svg-icon icon-class="user" />
|
|
|
- </span>
|
|
|
- <el-input
|
|
|
- ref="username"
|
|
|
- v-model="loginForm.username"
|
|
|
- placeholder="Username"
|
|
|
- name="username"
|
|
|
- type="text"
|
|
|
- tabindex="1"
|
|
|
+ <el-row class="window-login">
|
|
|
+ <el-col :span="9">
|
|
|
+ <div id="u35">
|
|
|
+ <div id="u37">
|
|
|
+ <div id="u39">
|
|
|
+ <div id="u39_text" class="text ">
|
|
|
+ <span></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div id="u38">
|
|
|
+ <div id="u38_text" class="text">
|
|
|
+ <p style="font-size:20px;line-height:normal;">
|
|
|
+ <span style="font-family:'FZXBSJW--GB1-0', 'FZXiaoBiaoSong-B05S', sans-serif;font-weight:400;">
|
|
|
+ 牵引供电维护管理信息化系统
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+ <p style="font-size:14px;line-height:24px;margin-top: 5px">
|
|
|
+ <span style="font-family:'Helvetica', sans-serif;font-weight:400;">
|
|
|
+ Information System Platform
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="15">
|
|
|
+ <el-form
|
|
|
+ ref="loginForm"
|
|
|
+ :model="loginForm"
|
|
|
+ :rules="loginRules"
|
|
|
+ class="login-form"
|
|
|
auto-complete="on"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- <el-form-item prop="password">
|
|
|
- <span class="svg-container">
|
|
|
- <svg-icon icon-class="password" />
|
|
|
- </span>
|
|
|
- <el-input
|
|
|
- :key="passwordType"
|
|
|
- ref="password"
|
|
|
- v-model="loginForm.password"
|
|
|
- :type="passwordType"
|
|
|
- placeholder="Password"
|
|
|
- name="password"
|
|
|
- tabindex="2"
|
|
|
- auto-complete="on"
|
|
|
- @keyup.enter.native="handleLogin"
|
|
|
- />
|
|
|
- <span class="show-pwd" @click="showPwd">
|
|
|
- <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
|
|
|
- </span>
|
|
|
- </el-form-item>
|
|
|
+ label-position="left"
|
|
|
+ >
|
|
|
+ <div class="title-container" style="margin-top:45px;margin-bottom: 80px">
|
|
|
+ <h2 class="title">用户登录 <span style="font-size: 15px">USER LOGIN</span></h2>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-form-item prop="username">
|
|
|
+ <el-input
|
|
|
+ ref="username"
|
|
|
+ v-model="loginForm.username"
|
|
|
+ placeholder="请输入用户名"
|
|
|
+ name="username"
|
|
|
+ prefix-icon="el-icon-s-check"
|
|
|
+ type="text"
|
|
|
+ tabindex="1"
|
|
|
+ auto-complete="on"
|
|
|
+ size="medium"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">Login</el-button>
|
|
|
+ <el-form-item prop="password" style="position: relative">
|
|
|
+ <el-input
|
|
|
+ :key="passwordType"
|
|
|
+ ref="password"
|
|
|
+ v-model="loginForm.password"
|
|
|
+ :type="passwordType"
|
|
|
+ placeholder="请输入密码"
|
|
|
+ name="password"
|
|
|
+ prefix-icon="el-icon-lock"
|
|
|
+ tabindex="2"
|
|
|
+ auto-complete="on"
|
|
|
+ />
|
|
|
+ <span class="show-pwd" style="position: absolute;right: 12px;top: 8px;" @click="showPwd">
|
|
|
+ <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
|
|
|
+ </span>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <div class="tips">
|
|
|
- <span style="margin-right:20px;">username: admin</span>
|
|
|
- <span> password: any</span>
|
|
|
- </div>
|
|
|
+ <el-form-item prop="code">
|
|
|
+ <el-input
|
|
|
+ ref="code"
|
|
|
+ v-model="loginForm.code"
|
|
|
+ style="width: 70%;vertical-align:middle"
|
|
|
+ placeholder="请输入验证码"
|
|
|
+ prefix-icon="el-icon-lock"
|
|
|
+ tabindex="2"
|
|
|
+ auto-complete="on"
|
|
|
+ @keyup.enter.native="handleLogin"
|
|
|
+ />
|
|
|
+ <img :src="imgSrc" alt="" style="margin-left:5%;width: 25%;height: 45px;vertical-align:middle;" @click="captchaImage">
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- </el-form>
|
|
|
+ <el-form-item>
|
|
|
+ <el-tooltip class="item" effect="dark" content="请联系管理员重置密码" placement="top">
|
|
|
+ <el-button type="text" style="float: right;padding:0">忘记密码?</el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-form-item>
|
|
|
+ <el-button
|
|
|
+ :loading="loading"
|
|
|
+ type="primary"
|
|
|
+ style="width:100%;margin-bottom:30px;"
|
|
|
+ @click.native.prevent="handleLogin"
|
|
|
+ ><h2 style="margin: 5px">登 录</h2>
|
|
|
+ </el-button>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { validUsername } from '@/utils/validate'
|
|
|
-
|
|
|
+import { captchaImage } from '@/api/user'
|
|
|
export default {
|
|
|
name: 'Login',
|
|
|
data() {
|
|
|
- const validateUsername = (rule, value, callback) => {
|
|
|
- if (!validUsername(value)) {
|
|
|
- callback(new Error('Please enter the correct user name'))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
- }
|
|
|
- }
|
|
|
- const validatePassword = (rule, value, callback) => {
|
|
|
- if (value.length < 6) {
|
|
|
- callback(new Error('The password can not be less than 6 digits'))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
- }
|
|
|
- }
|
|
|
return {
|
|
|
loginForm: {
|
|
|
- username: 'admin',
|
|
|
- password: '111111'
|
|
|
+ username: '',
|
|
|
+ password: '',
|
|
|
+ code: '',
|
|
|
+ uuid: ''
|
|
|
},
|
|
|
loginRules: {
|
|
|
- username: [{ required: true, trigger: 'blur', validator: validateUsername }],
|
|
|
- password: [{ required: true, trigger: 'blur', validator: validatePassword }]
|
|
|
+ username: [{ required: true, trigger: 'blur', message: '请输入用户名' }],
|
|
|
+ password: [{ required: true, trigger: 'blur', message: '请输入密码' }],
|
|
|
+ code: [{ required: true, trigger: 'blur', message: '请输入验证码' }]
|
|
|
},
|
|
|
loading: false,
|
|
|
passwordType: 'password',
|
|
|
- redirect: undefined
|
|
|
+ redirect: undefined,
|
|
|
+ imgSrc: ''
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -94,7 +133,16 @@ export default {
|
|
|
immediate: true
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.captchaImage()
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ captchaImage() {
|
|
|
+ captchaImage({ type: 'math' }).then(res => {
|
|
|
+ const url = window.URL.createObjectURL(res)
|
|
|
+ this.imgSrc = url
|
|
|
+ })
|
|
|
+ },
|
|
|
showPwd() {
|
|
|
if (this.passwordType === 'password') {
|
|
|
this.passwordType = ''
|
|
|
@@ -126,112 +174,99 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
-/* 修复input 背景不协调 和光标变色 */
|
|
|
-/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
|
|
|
+ .login-container {
|
|
|
+ .el-form {
|
|
|
+ width: 90%;
|
|
|
+ margin: 0 auto;
|
|
|
+ .el-input__inner{
|
|
|
+ height: 50px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|
|
|
|
|
|
-$bg:#283443;
|
|
|
-$light_gray:#fff;
|
|
|
-$cursor: #fff;
|
|
|
+<style lang="css" scoped>
|
|
|
|
|
|
-@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
|
|
|
- .login-container .el-input input {
|
|
|
- color: $cursor;
|
|
|
+ .login-container {
|
|
|
+ min-height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
-/* reset element-ui css */
|
|
|
-.login-container {
|
|
|
- .el-input {
|
|
|
- display: inline-block;
|
|
|
- height: 47px;
|
|
|
- width: 85%;
|
|
|
-
|
|
|
- input {
|
|
|
- background: transparent;
|
|
|
- border: 0px;
|
|
|
- -webkit-appearance: none;
|
|
|
- border-radius: 0px;
|
|
|
- padding: 12px 5px 12px 15px;
|
|
|
- color: $light_gray;
|
|
|
- height: 47px;
|
|
|
- caret-color: $cursor;
|
|
|
-
|
|
|
- &:-webkit-autofill {
|
|
|
- box-shadow: 0 0 0px 1000px $bg inset !important;
|
|
|
- -webkit-text-fill-color: $cursor !important;
|
|
|
- }
|
|
|
- }
|
|
|
+ .window-login {
|
|
|
+ overflow: hidden;
|
|
|
+ border-radius: 15px;
|
|
|
+ margin: 0 auto;
|
|
|
+ margin-top: 9%;
|
|
|
+ width: 800px;
|
|
|
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)
|
|
|
}
|
|
|
|
|
|
- .el-form-item {
|
|
|
- border: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
- background: rgba(0, 0, 0, 0.1);
|
|
|
- border-radius: 5px;
|
|
|
- color: #454545;
|
|
|
+ #u35 {
|
|
|
+ width: 100%;
|
|
|
+ height: 540px;
|
|
|
+ font-family: '微软雅黑', sans-serif;
|
|
|
+ font-weight: 400;
|
|
|
+ font-style: normal;
|
|
|
+ background-image: url(https://axure-file.lanhuapp.com/83ee941a-8080-4603-ab36-dc56ce561371__b332944a16cd91abd30b3a70f019b96f.svg);
|
|
|
}
|
|
|
-}
|
|
|
-</style>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
-$bg:#2d3a4b;
|
|
|
-$dark_gray:#889aa4;
|
|
|
-$light_gray:#eee;
|
|
|
-
|
|
|
-.login-container {
|
|
|
- min-height: 100%;
|
|
|
- width: 100%;
|
|
|
- background-color: $bg;
|
|
|
- overflow: hidden;
|
|
|
+ #u37 {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background-image: url(https://axure-file.lanhuapp.com/83ee941a-8080-4603-ab36-dc56ce561371__3da133640c87c7921faf320a11a3196b.svg);
|
|
|
+ background-position: left top;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-attachment: scroll;
|
|
|
+ background-size: 1440px 712px;
|
|
|
+ background-origin: border-box;
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
|
|
|
- .login-form {
|
|
|
- position: relative;
|
|
|
- width: 520px;
|
|
|
- max-width: 100%;
|
|
|
- padding: 160px 35px 0;
|
|
|
- margin: 0 auto;
|
|
|
- overflow: hidden;
|
|
|
+ #u38 {
|
|
|
+ height: 60px;
|
|
|
+ color: #FFFFFF;
|
|
|
}
|
|
|
|
|
|
- .tips {
|
|
|
- font-size: 14px;
|
|
|
- color: #fff;
|
|
|
- margin-bottom: 10px;
|
|
|
+ #u38 p {
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
|
|
|
- span {
|
|
|
- &:first-of-type {
|
|
|
- margin-right: 16px;
|
|
|
- }
|
|
|
- }
|
|
|
+ #u38 .text {
|
|
|
+ text-align: center;
|
|
|
+ padding: 2px 2px 2px 2px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ width: 100%;
|
|
|
}
|
|
|
|
|
|
- .svg-container {
|
|
|
- padding: 6px 5px 6px 15px;
|
|
|
- color: $dark_gray;
|
|
|
- vertical-align: middle;
|
|
|
- width: 30px;
|
|
|
- display: inline-block;
|
|
|
+ #u38_text {
|
|
|
+ word-wrap: break-word;
|
|
|
+ text-transform: none;
|
|
|
}
|
|
|
|
|
|
- .title-container {
|
|
|
+ #u39 {
|
|
|
position: relative;
|
|
|
-
|
|
|
- .title {
|
|
|
- font-size: 26px;
|
|
|
- color: $light_gray;
|
|
|
- margin: 0px auto 40px auto;
|
|
|
- text-align: center;
|
|
|
- font-weight: bold;
|
|
|
- }
|
|
|
+ margin: 0 auto;
|
|
|
+ width: 50px;
|
|
|
+ height: 100px;
|
|
|
+ display: flex;
|
|
|
+ font-family: 'Font Awesome 5 Pro Solid', 'Font Awesome 5 Pro Regular', 'Font Awesome 5 Pro', sans-serif;
|
|
|
+ font-weight: 900;
|
|
|
+ font-style: normal;
|
|
|
+ font-size: 72px;
|
|
|
+ color: #FFFFFF;
|
|
|
}
|
|
|
|
|
|
- .show-pwd {
|
|
|
+ #u39 .text {
|
|
|
position: absolute;
|
|
|
- right: 10px;
|
|
|
- top: 7px;
|
|
|
- font-size: 16px;
|
|
|
- color: $dark_gray;
|
|
|
- cursor: pointer;
|
|
|
- user-select: none;
|
|
|
+ align-self: center;
|
|
|
+ padding: 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ #u39_text {
|
|
|
+ word-wrap: break-word;
|
|
|
+ text-transform: none;
|
|
|
}
|
|
|
-}
|
|
|
</style>
|