谢杰标 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;