123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <template>
- <div class="login">
- <!--<div class="login-header">
- <img src="../../assets/image/e_logo5.png" class="logo" />
- <span class="welcome-login">欢迎登录</span>
- </div>-->
- <!--<div class="login">
- <div class="drag">
- <div style="background:rgba(255,255,255,0.1); border-radius:5px;">
- <Card icon="log-in" title="智慧课堂管理平台" :bordered="false" class="login-card">
- <div class="form-con">
- <Form ref="loginForm" :model="form" :rules="rules" @keydown.enter.native="handleSubmit">
- <FormItem prop="userName">
- <Input v-model="form.userName" placeholder="请输入用户名">
- <span slot="prepend">
- <Icon :size="16" type="ios-person"></Icon>
- </span>
- </Input>
- </FormItem>
- <FormItem prop="password">
- <Input type="password" v-model="form.password" placeholder="请输入密码">
- <span slot="prepend">
- <Icon :size="14" type="md-lock"></Icon>
- </span>
- </Input>
- </FormItem>
- <FormItem>
- <Button @click="handleSubmit" type="primary" :loading="loading" long>登 录</Button>
- </FormItem>
- </Form>
- <span style="float:left;color:#999999;cursor:pointer;">忘记密码?</span>
- <span style="float:right;color:#999999;cursor:pointer;">立刻注册>>></span>
- </div>
- </Card>
- </div>
- </div>
- </div>-->
- <div class="login-wrap">
- <div class="login-left">
- <img class="login-logo" src="../../assets/image/e_logo6.png"/>
- <img class="login-img" src="../../assets/image/login_img1.png" />
- </div>
- <div class="login-right">
- <div class="form-con">
- <Form ref="loginForm" :model="form" :rules="rules" @keydown.enter.native="handleSubmit">
- <FormItem prop="userName">
- <Input v-model="form.userName" placeholder="请输入用户名">
- <span slot="prepend">
- <Icon :size="30" type="ios-person"></Icon>
- </span>
- </Input>
- </FormItem>
- <FormItem prop="password">
- <Input type="password" v-model="form.password" placeholder="请输入密码">
- <span slot="prepend">
- <Icon :size="30" type="md-lock"></Icon>
- </span>
- </Input>
- </FormItem>
- <FormItem>
- <Button @click="handleSubmit" type="primary" :loading="loading" long style="padding:5px 0px; border-radius:25px;width:90%;margin-left:5%;font-size:18px;margin-top:15px;">登 录</Button>
- </FormItem>
- </Form>
- <!--<span style="float:left;color:#999999;cursor:pointer;">忘记密码?</span>
- <span style="float:right;color:#999999;cursor:pointer;">立刻注册>>></span>-->
- </div>
- </div>
- </div>
- </div>
-
- </template>
- <script>
- export default {
- name: 'LoginForm',
- props: {
- userNameRules: {
- type: Array,
- default: () => {
- return [
- { required: true, message: '账号不能为空', trigger: 'blur' }
- ]
- }
- },
- passwordRules: {
- type: Array,
- default: () => {
- return [
- { required: true, message: '密码不能为空', trigger: 'blur' }
- ]
- }
- }
- },
- data() {
- return {
- loading:false,
- form: {
- userName: '',
- password: ''
- }
- }
- },
- computed: {
- rules() {
- return {
- userName: this.userNameRules,
- password: this.passwordRules
- }
- }
- },
- methods: {
- loginSuccess() {
- if (this.form.userName == "admin" && this.form.password == "habook") {
- this.$router.push({ path: '/main' });
- } else {
- this.$Message.error('账号或者密码错误!');
- }
-
- },
- handleSubmit() {
- this.$refs.loginForm.validate((valid) => {
- if (valid) {
- localStorage.setItem("userName", this.form.userName);
- localStorage.setItem("isLogin", 1);
- this.loading = true;
- setTimeout(() => {
- this.loading = false;
- this.loginSuccess();
- }, 1200);
- }
- })
- }
- }
- }
- </script>
- <style>
- .form-con {
- width:60%;
- margin-top:220px;
- margin:auto;
- }
- .form-con /deep/ .ivu-input {
- border: none;
- background-color: white !important;
- font-size:16px;
- }
- .form-con /deep/ .ivu-input-group-prepend {
- border:none;
- background-color:white;
- color:#5095FD;
- font-size:18px;
- }
- .form-con /deep/ .ivu-input-wrapper {
- border:none;
- border-bottom:1px solid #EFEFEF;
- margin-top:10px;
- }
- .login-right {
- width:49%;
- padding-top:100px;
- float:right;
- }
- .login-logo {
- width:300px;
- }
- .login-img {
- width:90%;
- margin-top:50px;
- }
- .login-left {
- width:50%;
- float:left;
- padding:0px 0px 0px 30px;
- border-right: 2px solid transparent;
- border-image: linear-gradient( top, #ffffff, #567dfd, #ffffff) 33 33;
- border-image: -webkit-linear-gradient( top, #ffffff, #567dfd,#ffffff) 33 33;
- border-image: -moz-linear-gradient( top, #ffffff, #567dfd, #ffffff) 33 33;
- border-image: -o-linear-gradient( top,#ffffff, #567dfd, #ffffff) 33 33;
- }
- .login {
- background-image: url('../../assets/image/login_bg3.png');
- width: 100%;
- height: 100%;
- background-size: cover;
- padding-top:180px;
- /*display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;*/
- }
- .login-wrap {
- width: 900px;
- height:500px;
- padding:25px 0px;
- background:white;
- margin:auto;
- border-radius:30px;
- box-sizing:border-box;
- }
- .welcome-login {
- float: right;
- line-height: 80px;
- margin-right: 120px;
- font-size: 22px;
- font-weight: 800;
- color: #1196D2;
- }
- .login-header {
- width:100%;
- height:80px;
- background-color:#fff;
- position:absolute;
- z-index:10;
- /*box-shadow: 0 -5px 10px 6px #41b6ba inset;*/
- }
- .logo {
- height: 60px;
- margin-top:10px;
- margin-left:100px;
- }
- .login:after {
- content: "";
- width: 100%;
- height: 100%;
- position: relative;
- left: 0;
- top: 0;
- background: inherit;
- filter: blur(4px);
- z-index: 1;
- }
- .drag {
- position: absolute;
- text-align: center;
- z-index: 11;
- border-radius: 5px;
- box-shadow: 0 0 10px 6px rgba(0,0,0,.5);
- width: 90%;
- max-width: 350px;
- background:white;
- }
- .login-tip {
- color: white;
- }
- .drag >>> .ivu-card-head p span {
- color: #555555;
- /*padding-top:10px;*/
- display:inline-block;
- font-size: 18px;
- }
- .login-card {
- background: none;
- padding-bottom:20px;
- color: black;
- width: 100%;
- }
- .login-wrap .ivu-input:focus{
- border: none !important;
- outline: none !important;
- box-shadow: none !important;
- }
- </style>
|