From 879a3501a8ab9767a59458ad8c337f6c25e2e7c4 Mon Sep 17 00:00:00 2001
From: lixuliang <lixuliang_hd@126.com>
Date: 星期五, 22 十一月 2024 10:57:27 +0800
Subject: [PATCH] 代码更新

---
 src/components/login.vue |  150 +++++++++++++++++++++----------------------------
 1 files changed, 64 insertions(+), 86 deletions(-)

diff --git a/src/components/login.vue b/src/components/login.vue
index eaa8230..9a4064d 100644
--- a/src/components/login.vue
+++ b/src/components/login.vue
@@ -1,20 +1,8 @@
 <template>
   <div class="container">
-    <vue-particles
-      :particleOpacity="0.7"
-      :particlesNumber="80"
-      shapeType="circle"
-      :particleSize="4"
-      :linesWidth="1"
-      :lineLinked="true"
-      :lineOpacity="0.4"
-      :linesDistance="80"
-      :moveSpeed="2"
-      :hoverEffect="true"
-      hoverMode="grab"
-      :clickEffect="false"
-      clickMode="bubble"
-    ></vue-particles>
+    <vue-particles :particleOpacity="0.7" :particlesNumber="80" shapeType="circle" :particleSize="4" :linesWidth="1"
+      :lineLinked="true" :lineOpacity="0.4" :linesDistance="80" :moveSpeed="2" :hoverEffect="true" hoverMode="grab"
+      :clickEffect="false" clickMode="bubble"></vue-particles>
     <div class="MapMenu">
       <iframe id="ifream" style="border: none" width="100%" height="100%" v-bind:src="reportUrl"></iframe>
     </div>
@@ -28,25 +16,13 @@
       </div>
       <el-form :model="loginForm" :rules="rules" ref="loginForm" class="loginForm">
         <el-form-item prop="username">
-          <el-input
-            v-model="loginForm.username"
-            placeholder="杈撳叆鐧诲綍璐﹀彿"
-            class="nobr"
-            size="meddle"
-            autocomplete="off"
-          >
+          <el-input v-model="loginForm.username" placeholder="杈撳叆鐧诲綍璐﹀彿" class="nobr" size="meddle" autocomplete="off">
             <i slot="prefix" class="el-icon-user"></i>
           </el-input>
         </el-form-item>
 
         <el-form-item prop="password">
-          <el-input
-            show-password
-            v-model="loginForm.password"
-            placeholder="璇疯緭鍏ョ櫥褰曞瘑鐮�"
-            class="nobr"
-            autocomplete="off"
-          >
+          <el-input show-password v-model="loginForm.password" placeholder="璇疯緭鍏ョ櫥褰曞瘑鐮�" class="nobr" autocomplete="off">
             <i slot="prefix" class="el-icon-lock"></i>
           </el-input>
         </el-form-item>
@@ -54,12 +30,8 @@
         <el-form-item required>
           <el-col :span="18">
             <el-form-item prop="validCode">
-              <el-input
-                @keyup.enter.native="submitForm('loginForm')"
-                v-model="loginForm.validCode"
-                placeholder="璇疯緭鍏ラ獙璇佺爜锛堝拷鐣ュぇ灏忓啓锛�"
-                class="nobr"
-              ></el-input>
+              <el-input @keyup.enter.native="submitForm('loginForm')" v-model="loginForm.validCode"
+                placeholder="璇疯緭鍏ラ獙璇佺爜锛堝拷鐣ュぇ灏忓啓锛�" class="nobr"></el-input>
             </el-form-item>
           </el-col>
 
@@ -68,13 +40,8 @@
           </el-col>
         </el-form-item>
         <el-form-item>
-          <el-button
-            type="primary"
-            class="nobr loginbtn"
-            style
-            :loading="loading"
-            @click="submitForm('loginForm')"
-          >鐧诲綍</el-button>
+          <el-button type="primary" class="nobr loginbtn" style :loading="loading"
+            @click="submitForm('loginForm')">鐧诲綍</el-button>
         </el-form-item>
       </el-form>
     </div>
@@ -106,13 +73,13 @@
     };
 
     const checkValidCode = (rule, value, callback) => {
-      if (!value) {
-        callback(new Error("璇疯緭鍏ラ獙璇佺爜"));
-      } else if (value.toUpperCase() !== this.validCode.toUpperCase()) {
-        callback(new Error("楠岃瘉鐮佷笉姝g‘"));
-      } else {
-        callback();
-      }
+      // if (!value) {
+      //   callback(new Error("璇疯緭鍏ラ獙璇佺爜"));
+      // } else if (value.toUpperCase() !== this.validCode.toUpperCase()) {
+      //   callback(new Error("楠岃瘉鐮佷笉姝g‘"));
+      // } else {
+      //   callback();
+      // }
     };
     return {
       validCode: "",
@@ -157,44 +124,45 @@
     },
     // 璐﹀彿瀵嗙爜鐧诲綍
     submitForm(formName) {
-      this.$refs[formName].validate(valid => {
-        if (valid) {
-          // this.$router.push("/index");
-          const loading = this.$loading({
-            lock: true,
-            text: "Loading",
-            spinner: "el-icon-loading",
-            background: "rgba(0, 0, 0, 0.7)"
-          });
-          this.$store
-            .dispatch("Login", this.loginForm)
-            .then(() => {
-              loading.close();
-              this.$router.push("/index");
-              // }
-            })
-            .catch(error => {
-              //缃戠粶瓒呮椂寮傚父澶勭悊
-              loading.close();
-              if (
-                error.code === "ECONNABORTED" ||
-                error.message === "Network Error" ||
-                error.message.includes("timeout")
-              ) {
-                this.$message.error("璇锋眰瓒呮椂锛岃绋嶅悗閲嶈瘯");
-              }
-              return Promise.resolve(error.response);
-              // reject(error);
-            });
-          this.validCode = ""; //娓呯┖楠岃瘉鐮佽緭鍏ユ鐨勫唴瀹�
-          this.refreshVcode(); //鍒锋柊楠岃瘉鐮�
-        } else {
-          this.validCode = ""; //娓呯┖楠岃瘉鐮佽緭鍏ユ鐨勫唴瀹�
-          this.refreshVcode(); //鍒锋柊楠岃瘉鐮�
+      this.$router.push("/index");
+      // this.$refs[formName].validate(valid => {
+      //   if (valid) {
+        
+      //     const loading = this.$loading({
+      //       lock: true,
+      //       text: "Loading",
+      //       spinner: "el-icon-loading",
+      //       background: "rgba(0, 0, 0, 0.7)"
+      //     });
+      //     this.$store
+      //       .dispatch("Login", this.loginForm)
+      //       .then(() => {
+      //         loading.close();
+      //         this.$router.push("/index");
+      //         // }
+      //       })
+      //       .catch(error => {
+      //         //缃戠粶瓒呮椂寮傚父澶勭悊
+      //         loading.close();
+      //         if (
+      //           error.code === "ECONNABORTED" ||
+      //           error.message === "Network Error" ||
+      //           error.message.includes("timeout")
+      //         ) {
+      //           this.$message.error("璇锋眰瓒呮椂锛岃绋嶅悗閲嶈瘯");
+      //         }
+      //         return Promise.resolve(error.response);
+      //         // reject(error);
+      //       });
+      //     this.validCode = ""; //娓呯┖楠岃瘉鐮佽緭鍏ユ鐨勫唴瀹�
+      //     this.refreshVcode(); //鍒锋柊楠岃瘉鐮�
+      //   } else {
+      //     this.validCode = ""; //娓呯┖楠岃瘉鐮佽緭鍏ユ鐨勫唴瀹�
+      //     this.refreshVcode(); //鍒锋柊楠岃瘉鐮�
 
-          return false;
-        }
-      });
+      //     return false;
+      //   }
+      // });
     },
     refreshVcode() {
       this.$refs.refresh.createdCode();
@@ -215,6 +183,7 @@
 
   background: url("../assets/img/login.jpg") no-repeat center;
   background-size: 100% 100%;
+
   .MapMenu {
     width: 100%;
     height: 100%;
@@ -223,6 +192,7 @@
     position: absolute;
   }
 }
+
 .title_img {
   position: absolute;
   left: 75%;
@@ -233,18 +203,22 @@
   // background-color: #bfa;
   transform: translate(-50%, -40%);
 }
+
 .title_img img {
   width: 100%;
 }
+
 .main_img {
   position: absolute;
   left: 17%;
   top: 12%;
   /* transform: translateX(-50%); */
 }
+
 .main_img img {
   width: 100%;
 }
+
 .login {
   width: 372px;
   height: 400px;
@@ -265,16 +239,19 @@
   color: #3b4d6e;
   /* background-color: #bfa; */
 }
+
 .loginForm {
   margin-top: 61px;
   margin-left: 48px;
   /* background-color: #bfa; */
   width: 280px;
 }
+
 .el-form-item {
   /* margin-bottom: 12px; */
   height: 41px;
 }
+
 .el-input /deep/ .el-input__inner {
   /* background: rgba(80, 152, 255, 0.24); */
   border-color: rgba(0, 0, 0, 0.1);
@@ -285,6 +262,7 @@
   border: 0;
   padding: 0 !important;
 }
+
 .loginbtn {
   width: 280px;
   height: 50px;

--
Gitblit v1.9.3