Browse Source

登录页错误提示

zhangjinxing 3 years ago
parent
commit
103a7c9246
1 changed files with 8 additions and 11 deletions
  1. 8 11
      src/views/login/index.vue

+ 8 - 11
src/views/login/index.vue

@@ -19,7 +19,7 @@
             五常稻田<span>{{ ver }}</span>
           </h3>
         </div>
-<!-- 用户名 -->
+        <!-- 用户名 -->
         <el-form-item prop="username">
           <!-- <span class="svg-container">
             <svg-icon icon-class="user" />
@@ -36,14 +36,14 @@
             <i slot="prefix" class="el-icon-user-solid"></i>
           </el-input>
         </el-form-item>
-<!-- 文字提示是否大小写,固定在右边 -->
+        <!-- 文字提示是否大小写,固定在右边 -->
         <el-tooltip
           v-model="capsTooltip"
           content="Caps lock is On"
           placement="right"
           manual
         >
-<!-- 密码栏 -->
+          <!-- 密码栏 -->
           <el-form-item prop="password">
             <!-- <span class="svg-container">
               <svg-icon icon-class="password" />
@@ -61,7 +61,7 @@
               @blur="capsTooltip = false"
               @keyup.enter.native="handleLogin"
             >
-            <!-- 监听键盘事件,执行checkCapslock函数,判断提示框是否出现,失焦隐藏 -->
+              <!-- 监听键盘事件,执行checkCapslock函数,判断提示框是否出现,失焦隐藏 -->
               <i slot="prefix" class="el-icon-warning"></i>
               <i
                 slot="suffix"
@@ -71,7 +71,6 @@
                 }"
                 @click.native="showPwd"
               ></i>
-              
             </el-input>
           </el-form-item>
         </el-tooltip>
@@ -91,7 +90,7 @@
 
 <script>
 import asyncRequest from "@/apis/service/user";
-import resToken from "@/mixins/resToken";//登出文件
+import resToken from "@/mixins/resToken"; //登出文件
 export default {
   name: "Login",
   mixins: [resToken],
@@ -127,7 +126,7 @@ export default {
         ],
       },
       passwordType: "password",
-      capsTooltip: false,//绑定在tooltip文字提示的属性。
+      capsTooltip: false, //绑定在tooltip文字提示的属性。
       loading: false,
       showDialog: false,
       redirect: undefined,
@@ -178,7 +177,6 @@ export default {
     checkCapslock(e) {
       const { key } = e;
       this.capsTooltip = key && key.length === 1 && key >= "A" && key <= "Z";
-      
     },
     showPwd() {
       if (this.passwordType === "password") {
@@ -192,7 +190,6 @@ export default {
     },
     handleLogin() {
       this.$refs.loginForm.validate((valid) => {
-        
         if (valid) {
           this.loading = true;
           this.$store
@@ -201,7 +198,8 @@ export default {
               if (res.code === 0) {
                 this.getMenu();
               } else {
-                this.$message.warning(res.message);
+                console.log(res);
+                this.$message.warning(res.msg);
                 this.loading = false;
               }
             })
@@ -274,7 +272,6 @@ $light_gray: #f2f2f2;
 
   .el-form-item {
     padding: 0 8%;
-   
 
     //   border: 1px solid #e9e9e9;
     //   border-radius: 5px;