Browse Source

记住密码

See999 5 years ago
parent
commit
f774267785
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/pages/home/login.vue

+ 6 - 0
src/pages/home/login.vue View File

@@ -147,6 +147,7 @@ export default {
147 147
       }
148 148
 
149 149
       //与后端请求代码,本功能不需要与后台交互所以省略
150
+
150 151
       loginByPwd(this.form.mobile, hex_md5(this.form.pwd)).then(rs => {
151 152
         var resp = rs.data;
152 153
 
@@ -193,6 +194,11 @@ export default {
193 194
         "userPwd" + "=" + c_pwd + ";path=/;expires=" + exdate.toGMTString();
194 195
     },
195 196
     getCookie: function() {
197
+      this.$nextTick(() => {
198
+        if (this.form.pwd != "") {
199
+          this.checked = true;
200
+        }
201
+      });
196 202
       if (document.cookie.length > 0) {
197 203
         var arr = document.cookie.split("; "); //这里显示的格式需要切割一下自己可输出看下
198 204
         for (var i = 0; i < arr.length; i++) {