9286383c by joe

登錄、註冊功能修改

1 parent 00af06c9
......@@ -217,6 +217,7 @@ module.exports = {
e5: "Invalidate account or password, please re-enter",
e6: "Your password has been mistyped 4 times. Your account will be locked soon. Please retrieve your password!",
e7: "Your password has been mistyped 5 times. You can't log in again in 24 hours!",
e8: "The mobile no. has not been registered, please register before using!",
oe0: "Invalidate mobile no. , please re-enter",
oe1: "Please get SMS verification code first",
oe2: "Please enter the picture verification code",
......@@ -267,6 +268,8 @@ module.exports = {
e10: "Verification code was Expired",
e11: "Registration failed, please contact the staff",
e12: "Success",
e13: "The name can't not contain numbers, special numbers",
e14: "Please enter your name"
}
},
passwordCheck: {
......
......@@ -219,6 +219,7 @@ module.exports = {
e5: "賬號或密碼不正確",
e6: "您的密碼已輸錯4次,帳戶即將被鎖定,請找回密碼!",
e7: "您的密碼已輸錯5次,24小時內無法再登入!",
e8: "您的手機號還未註冊,請註冊後再使用!",
oe0: "請輸入正確的手機號",
oe1: "請先獲取短信驗證碼",
oe2: "請輸入圖片驗證碼",
......@@ -266,7 +267,9 @@ module.exports = {
e9: "兩次密碼不一致,請確認後重新輸入",
e10: "驗證碼過期,請重新申請驗證碼",
e11: "註冊失敗,請聯繫工作人員",
e12: "註冊成功"
e12: "註冊成功",
e13: "姓名不能包含數字、特殊號碼",
e14: "請輸入您的姓名"
},
accountPlaceholder:"請設置用戶名稱",
},
......
......@@ -219,6 +219,7 @@ module.exports = {
e5: "账号或密码不正确",
e6: "您的密码已输错4次,账户即将被锁定,请找回密码!",
e7: "您的密码已输错5次, 24小时内无法再登录!",
e8: "您的手机号还未注册,请注册后再使用!",
oe0: "请输入正确的手机号",
oe1: "请先获取短信验证码",
oe2: "请输入图片验证码",
......@@ -269,7 +270,9 @@ module.exports = {
e9: "两次输入的密码不一致",
e10: "验证码过期,请重新申请验证码",
e11: "注册失败,请联系工作人员",
e12: "註冊成功"
e12: "注册成功",
e13: "姓名不能包含数字、特殊字符",
e14: "請輸入您的姓名"
},
accountPlaceholder:"请设置用户名称",
},
......
......@@ -128,7 +128,8 @@ export default {
pwdLoginDisabledOneAccountCenterOff() {
let b1 = !this.loginCheck.agreeProtocol;
let b2 = !this.loginForm.userId;
let b3 = !this.loginForm.password;
// let b3 = !this.loginForm.password;
let b3 = false;
let b4 = !this.loginForm.otp;
let b = b1 || b2 || b3 || b4;
......@@ -266,7 +267,7 @@ export default {
},
// 不接入一账通登陆
pwdLoginWhenOneAccountCenterOff() {
if (this.pwdLoginDisabled) {
if (this.pwdLoginDisabledOneAccountCenterOff) {
return;
}
if (this.loading) {
......@@ -275,7 +276,7 @@ export default {
this.loading = true;
let data = {
account: this.loginForm.userId,
password: this.loginForm.password,
// password: this.loginForm.password,
otp: this.loginForm.otp
};
httpPost({
......@@ -289,7 +290,8 @@ export default {
this.loading = false;
switch (e.code) {
case 404:
this.errorTips.e2 = this.i18n.login.tips.e5;
// this.errorTips.e2 = this.i18n.login.tips.e5;
this.errorTips.e1 = this.i18n.login.tips.e8;
break;
case 1104:
this.errorTips.oe2 = this.i18n.login.tips.oe4;
......
......@@ -92,7 +92,8 @@
<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e1}}
</div>
</div>
<div class="pure-u-1 form-item">
<!-- 第二版,不需要密码-->
<!-- <div class="pure-u-1 form-item">
<div class="label">
<img src="@/assets/images/login/icon-login-password.png"> {{$t('login.password')}}
</div>
......@@ -102,7 +103,7 @@
<div class="validator" v-if="errorTips.e2.length > 0 ">
<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e2}}
</div>
</div>
</div> -->
<div class="pure-u-1 form-item">
<div class="label">
<img src="@/assets/images/login/icon-login-phone.png"> {{$t('login.SMSVerificationCode')}}
......
......@@ -7,7 +7,7 @@ import { mapState } from "vuex";
import api from "@/api/api";
import { httpGet, httpPost } from "@/api/fetch-api.js";
import { contactMethodCheck, checkVerifyCode } from "@utils/utils.js";
import { contactMethodCheck, checkVerifyCode, checkName } from "@utils/utils.js";
import modalComp from "@/components/modal-comp/modal-comp.vue";
import modalSimpleComp from "@/components/modal-simple-comp/modal-simple-comp.vue";
......@@ -105,15 +105,19 @@ export default {
return b1 || b2 || b3 || b4;
},
registerDisabledV2() {
let b1 =
!this.values.password || this.checkPassword(this.values.password)
? true
: false;
let b2 =
this.values.passwordRepeat != this.values.password ? true : false;
// let b1 =
// !this.values.password || this.checkPassword(this.values.password)
// ? true
// : false;
// let b2 =
// this.values.passwordRepeat != this.values.password ? true : false;
// 不需要密码校验了
let b1 = false;
let b2 = false;
let b3 = !this.registerCheck.agreeProtocol;
let b4 = !this.registerForm.mobileNo ? true : false;
return b1 || b2 || b3 || b4;
let b5 = !this.registerForm.userId ? true : false;
return b1 || b2 || b3 || b4 || b5;
},
submitDisabled() {
let b1 =
......@@ -257,7 +261,7 @@ export default {
let i18n = this.$i18n.messages[this.$i18n.locale] || {};
let msg = i18n.register.coutTips;
_this.times.tip = msg.replace("{second}", _this.times.remain);
this.times.interval = setInterval(function() {
this.times.interval = setInterval(function () {
if (_this.times.remain <= 0) {
clearInterval(_this.times.interval);
_this.times.interval = 0;
......@@ -300,17 +304,37 @@ export default {
}
this._checkMobileLegal();
},
checkNameActivity() {
this.errorTips.e1 = "";
if (!this.registerForm.userId) {
this.errorTips.e1 = this.i18n.register.tips.e14;
return false;
}
if (!checkName(this.registerForm.userId)) {
this.errorTips.e1 = this.i18n.register.tips.e13;
return false;
}
return true;
},
registerV2Handler() {
if (this.registerDisabledV2) {
return;
}
if (!this.checkNameActivity()) {
return;
}
if (!checkVerifyCode(this.registerForm.otp)) {
this._showOTPTip();
return;
}
if (this.loading) {
return;
}
this._checkMobileLegal().then(() => {
let data = {
account: this.registerForm.mobileNo,
password: this.values.password
userName: this.registerForm.userId,
otp: this.registerForm.otp
};
this.loading = true;
httpPost({
......@@ -329,6 +353,9 @@ export default {
let message = this.i18n.register.tips.e5;
this.errorTips.p1 = message;
break;
case 1104:
this.errorTips.p2 = this.i18n.login.tips.oe4;
break;
}
});
});
......@@ -582,8 +609,8 @@ export default {
// });
// alert("注册成功")
},
onForgetHandler() {},
onLoginTypeHandler(val) {},
onForgetHandler() { },
onLoginTypeHandler(val) { },
initData() {
if (this.userInfo && (this.userInfo.sid || this.userInfo.name)) {
this.$router.push({
......@@ -605,7 +632,39 @@ export default {
path: this.targetPath
});
}
},
sendOTPWhenOneAccountCenterOff() {
// 发送短信验证码
let mobileNo = this.registerForm.mobileNo;
let m1 = contactMethodCheck('hkmobile', mobileNo);
let m2 = contactMethodCheck('mobile', mobileNo);
if (!m1 && !m2) {
this._showMobileNoIllegalTip();
return;
}
if (this.times.remain > 0) {
return;
}
let data = {
mobile: mobileNo,
lan: this.locale,
scene: "register"
}
httpPost({
url: api.refreshSmgOtp,
data: data
}).then(res => {
this._startTimeClick();
}).catch(e => {
switch (e.code) {
case 1103:
this.errorTips.p1 = this.i18n.register.tips.e5
break;
}
console.error(e);
})
},
},
mounted() {
window.showSuccessMessage = this._showSuccessMessage;
......@@ -620,19 +679,22 @@ export default {
}
});
},
"registerForm.mobileNo": function() {
"registerForm.userId": function () {
this.errorTips.e1 = "";
},
"registerForm.mobileNo": function () {
this.errorTips.p1 = "";
},
"registerForm.opt": function() {
"registerForm.otp": function () {
this.errorTips.p2 = "";
},
"registerForm.imageValue": function() {
"registerForm.imageValue": function () {
this.errorTips.p3 = "";
},
"values.password": function() {
"values.password": function () {
this.$set(this.errorTips, "p4", this.checkPassword(this.values.password));
},
"values.passwordRepeat": function() {
"values.passwordRepeat": function () {
if (this.values.password != this.values.passwordRepeat) {
this._showPasswordNotTheSameTips();
} else {
......@@ -640,19 +702,19 @@ export default {
}
}
},
beforeDestroy() {},
beforeDestroy() { },
created() {
this.initData();
try {
this.$root.eventBus.$off("/register");
} catch (e) {}
} catch (e) { }
this.$root.eventBus.$on("/register", () => {
this.type = 1;
});
this.$root.eventBus.$on("langChange", () => {
try {
this.initData();
} catch (e) {}
} catch (e) { }
});
}
};
......
......@@ -6,6 +6,7 @@
<!-- 会员协议 -->
<modal-protocol-comp :visible="modalProtocolVisiable" :overlay="closeModal" :close="closeModal"></modal-protocol-comp>
<div class="ebg"></div>
<!-- 一账通模板-->
<div class="content" v-if="!oneAccountCenterOff">
<div class="top-space"></div>
<div class="step">
......@@ -125,7 +126,7 @@
</div>
</div>
<!-- OPT -->
<!-- 非一账通 -->
<div class="content" v-else>
<div class="top-space"></div>
<div class="box">
......@@ -138,14 +139,14 @@
<!-- 账号 -->
<div class="pure-u-1 form-item">
<div class="label">
<img src="@/assets/images/login/icon-login-user.png"> {{$t('login.account')}}
<img src="@/assets/images/login/icon-login-user.png"> {{$t('infomationImprove.t1')}}
</div>
<div class="ipt-wrap">
<!-- <input v-model="registerForm.userId" :placeholder="$t('register.accountPlaceholder')" class="ipt" :class="{ err : errorTips.e1.length > 0 }" type="text" @blur="userIdLegalCheck"> -->
<input v-model="registerForm.userId" :placeholder="$t('register.accountPlaceholder')" class="ipt" :class="{ err : errorTips.e1.length > 0 }" type="text" >
<input v-model="registerForm.userId" :placeholder="$t('register.accountPlaceholder')" class="ipt" :class="{ err : errorTips.e1.length > 0 }" type="text" @blur="checkNameActivity">
</div>
<div class="validator" v-if="errorTips.p1.length > 0 ">
<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p1}}
<div class="validator" v-if="errorTips.e1.length > 0 ">
<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e1}}
</div>
</div>
......@@ -178,15 +179,15 @@
<img src="@/assets/images/register/icon-register-phone.png"> {{$t('login.SMSVerificationCode')}}
</div>
<div class="ipt-wrap">
<div class="ipt ipt2" :class="{ err : errorTips.oe2.length > 0 }">
<div class="ipt ipt2" :class="{ err : errorTips.p2.length > 0 }">
<input :placeholder="$t('login.verifyCodePlaceholder')" class="ipt-code" type="text" v-model="registerForm.otp">
<!-- <div v-if="times.remain == 0" class="veri-btn pointer" @click="sendOTPWhenOneAccountCenterOff">{{$t('register.verifyCodeGet')}}</div> -->
<div v-if="times.remain == 0" class="veri-btn pointer" >{{$t('register.verifyCodeGet')}}</div>
<div v-if="times.remain == 0" class="veri-btn pointer" @click="sendOTPWhenOneAccountCenterOff">{{$t('register.verifyCodeGet')}}</div>
<!-- <div v-if="times.remain == 0" class="veri-btn pointer" >{{$t('register.verifyCodeGet')}}</div> -->
<div v-else class="veri-btn-default">{{times.tip}}</div>
</div>
</div>
<div class="validator" v-if="errorTips.oe2.length > 0 ">
<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.oe2}}
<div class="validator" v-if="errorTips.p2.length > 0 ">
<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p2}}
</div>
</div>
......