|
|
@@ -136,6 +136,7 @@ export default {
|
|
|
canPassport: true, // 是否可以验证
|
|
|
accountList: [], // 账密列表
|
|
|
accountLocal: [], // 本地存储的账密
|
|
|
+ checkPassportInput: false, // 是否校验过账号
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -161,6 +162,7 @@ export default {
|
|
|
/[\u4E00-\u9FA5]|[\uFE30-\uFFA0]|\s+|[^\w\u4e00-\u9fa5\/\-]|[/|]/gi,
|
|
|
""
|
|
|
);
|
|
|
+ this.checkPassportInput = false;
|
|
|
},
|
|
|
|
|
|
// 初始化操作
|
|
|
@@ -207,6 +209,7 @@ export default {
|
|
|
this.$toast.text("此账号已被注册");
|
|
|
return;
|
|
|
}
|
|
|
+ this.checkPassportInput = true;
|
|
|
this.$toast.text("此账号可用");
|
|
|
});
|
|
|
},
|
|
|
@@ -223,8 +226,6 @@ export default {
|
|
|
this.$toast.text("手机号格式不正确");
|
|
|
return;
|
|
|
}
|
|
|
- // 2. 验证码倒计时
|
|
|
- this.countDown();
|
|
|
|
|
|
// 3. 请求接口 发送验证码
|
|
|
this.$api
|
|
|
@@ -237,8 +238,11 @@ export default {
|
|
|
const { code, data, msg } = res.data;
|
|
|
// 错误
|
|
|
if (code) {
|
|
|
+ this.canVerif = false;
|
|
|
return;
|
|
|
}
|
|
|
+ // 2. 验证码倒计时
|
|
|
+ this.countDown();
|
|
|
});
|
|
|
},
|
|
|
|
|
|
@@ -272,6 +276,7 @@ export default {
|
|
|
passwordAgin,
|
|
|
ischeckRegPhone,
|
|
|
passport,
|
|
|
+ checkPassportInput,
|
|
|
} = this;
|
|
|
|
|
|
// 0. 校验账号是否为空
|
|
|
@@ -279,6 +284,13 @@ export default {
|
|
|
this.$toast.text("账号不能为空");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ // 是否验证过账号
|
|
|
+ if (!checkPassportInput) {
|
|
|
+ this.$toast.text("请先验证账号是否可用");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
// 1. 验证手机号格式
|
|
|
const telCheck = this.$utils.checkVerification(phoneNumber);
|
|
|
if (!telCheck) {
|
|
|
@@ -363,7 +375,7 @@ export default {
|
|
|
initAccountList() {
|
|
|
// const accountLocal = JSON.parse(localStorage.getItem("jhremember"));
|
|
|
let accountLocal = this.$utils.readStorage("", "jhremember");
|
|
|
- accountLocal = JSON.parse(accountLocal);
|
|
|
+ accountLocal = accountLocal && JSON.parse(accountLocal);
|
|
|
accountLocal &&
|
|
|
accountLocal.length &&
|
|
|
accountLocal.map((ele) => {
|