From 08b5ddfa9a0a2ed52bd7d7b98ca16ef4dcc610a6 Mon Sep 17 00:00:00 2001
From: zhangxiaoxu123 <819527061@qq.com>
Date: 星期二, 13 九月 2022 14:19:43 +0800
Subject: [PATCH] 页面修改

---
 src/pages/login.vue |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/pages/login.vue b/src/pages/login.vue
index 95512a7..c28b162 100644
--- a/src/pages/login.vue
+++ b/src/pages/login.vue
@@ -47,14 +47,15 @@
   </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: {
         // 楠岃瘉鐢ㄦ埛鍚嶆槸鍚﹀悎娉�
@@ -76,7 +77,12 @@
       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')
+          // })
       });
     }
   }
@@ -139,7 +145,7 @@
 .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;
 }
@@ -147,7 +153,7 @@
 .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;
@@ -164,7 +170,7 @@
   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;
 }
@@ -175,14 +181,14 @@
   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;

--
Gitblit v1.9.1