소스 검색

记住密码

谢杰标 2 년 전
부모
커밋
c507b2808f
1개의 변경된 파일15개의 추가작업 그리고 0개의 파일을 삭제
  1. 15 0
      pages4/login/login.vue

+ 15 - 0
pages4/login/login.vue

@@ -426,6 +426,11 @@ export default {
         (res) => {
           that.isUse = false;
           if (res.data.code == 200) {
+            // 记住账号
+            uni.setStorageSync("rememberPwLoginMsg", {
+              account: this.form.account,
+              pwd: this.form.pwd,
+            });
             this.loginCallback(res, "pwlogin");
           } else {
             that.$u.toast(res.data.msg);
@@ -466,6 +471,16 @@ export default {
     },
     sectionChange(index) {
       this.current = index;
+      // #ifdef H5
+      if (index == 0) {
+        const rememberPwLoginMsg = uni.getStorageSync("rememberPwLoginMsg");
+        if (rememberPwLoginMsg) {
+          let { account, pwd } = rememberPwLoginMsg;
+          this.form.account = account;
+          this.form.pwd = pwd;
+        }
+      }
+      // #endif
     },
     getPhoneNumber(e) {
       let that = this;