Browse Source

fix remember password in login

Starink 6 years ago
parent
commit
454b25f12f
1 changed files with 4 additions and 3 deletions
  1. 4 3
      pages/login.vue

+ 4 - 3
pages/login.vue

@@ -47,13 +47,13 @@
       this.makeCode(this.identifyCodes, 4);
       this.canvasWidth = this.$refs.canvas.clientWidth;
       if(localStorage.phone){
-        localStorage.phone = this.phone;
+        this.phone = localStorage.phone;
       }
       if(localStorage.password){
-        localStorage.password = this.password;
+        this.password = localStorage.password;
       }
       if(localStorage.rememberPassword){
-        localStorage.rememberPassword = this.rememberPassword;
+        this.rememberPassword = true;
       }
     },
     methods: {
@@ -146,6 +146,7 @@
                 localStorage.rememberPassword = this.rememberPassword;
               }else{
                 localStorage.removeItem("password");
+                localStorage.removeItem("rememberPassword");
               }
 
               // this.$store.commit("saveUser", res.data.user);