| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | // import {login} from "@/api/index"; |
| | | import {login} from "@/api/index"; |
| | | |
| | | export default { |
| | | name: "login", |
| | | data() { |
| | | return { |
| | | loginForm: { |
| | | username: "admin", |
| | | password: "123456" |
| | | username: "", |
| | | password: "", |
| | | }, |
| | | loginFormRules: { |
| | | // 验证用户名是否合法 |
| | |
| | | this.$refs.loginFormRef.validate(async valid => { |
| | | console.log(valid); |
| | | if (!valid) return; |
| | | this.$router.push("/"); |
| | | this.$store.dispatch('login',this.loginForm).then(res => { |
| | | this.$router.push('/index') |
| | | }) |
| | | // login(this.loginForm).then(res => { |
| | | // this.$router.push('/index') |
| | | // }) |
| | | }); |
| | | } |
| | | } |
| | |
| | | .login-container { |
| | | width: 10rem; |
| | | height: 6.5625rem; |
| | | background: url(../assets/images/login/loginBackground@2x.png) no-repeat; |
| | | background: url(../assets/images/login/loginBackground.jpg) no-repeat; |
| | | background-size: 100%; |
| | | position: relative; |
| | | } |
| | |
| | | .title { |
| | | width: 13.0612rem; |
| | | height: 0.5rem; |
| | | background: url(../assets/images/login/top@2x.png) no-repeat; |
| | | background: url(../assets/images/login/top.png) no-repeat; |
| | | background-size: 100%; |
| | | position: absolute; |
| | | left: -1.5306rem; |
| | |
| | | position: absolute; |
| | | width: 0.3438rem; |
| | | height: 0.3359rem; |
| | | background: url(../assets/images/login/header@2x.png) no-repeat; |
| | | background: url(../assets/images/login/header.png) no-repeat; |
| | | background-size: 100%; |
| | | border-right: 0.0039rem dashed #51d2ff; |
| | | } |
| | |
| | | width: 0.3438rem; |
| | | height: 0.3359rem; |
| | | border-right: 0.0039rem dashed #51d2ff; |
| | | background: url(../assets/images/login/lock@2x_1.png) no-repeat; |
| | | background: url(../assets/images/login/lock_1.png) no-repeat; |
| | | background-size: 100%; |
| | | } |
| | | |
| | | .loginBox { |
| | | width: 3.125rem; |
| | | height: 3.1979rem; |
| | | background: url(../assets/images/login/loginBorder@2x.png); |
| | | background: url(../assets/images/login/loginBorder.png); |
| | | background-size: 100%; |
| | | position: relative; |
| | | margin: 0 auto; |