0861646c by joe

1

1 parent 03e454cc
......@@ -18,6 +18,8 @@ module.exports = {
changePassword : "/pingan_hklife_webapi/password/change",
// 短信验证码登录
otpLogin : "/pingan_hklife_webapi/user/otpLogin",
// 短信验证码登录
otpRegisterAndLogin : "/pingan_hklife_webapi/user/otpRegisterAndLogin",
// 找回密码:定位用户信息
locateUserInfo : "/pingan_hklife_webapi/reset/locateUserInfo",
// 找回密码:发送验证码
......
......@@ -57,6 +57,9 @@ export default {
oe1: "", // 账号
oe2: "", // 短信验证码
oe3: "", // 图像验证码
// 注册
p4: "",
p5: ""
},
modalVisiable: false,
targetPath: "",
......@@ -96,7 +99,7 @@ export default {
onSubmitHandler() {
},
onRegisterHandler() {
toRegisterPage() {
this.$router.push({
path: "/register"
});
......@@ -194,6 +197,7 @@ export default {
this.showModal(message, "info");
},
_showLoginErrorMessage(response) {
// response.returnCode = "GS_RESETPWD_ERROR_NOUSERINFO";
switch (response.returnCode) {
case "SMS_ERROR_006":
// 短信验证码不正确
......@@ -208,6 +212,10 @@ export default {
// 登录错误4次、5次
this.showModal(response.returnMsg, "info");
return;
case "GS_RESETPWD_ERROR_NOUSERINFO":
// 这个是用户OTP验证成功后没有账号导致
this.type = 3;
break;
default:
this.showModal(this.i18n.login.tips.e5, "info");
break;
......@@ -291,6 +299,23 @@ export default {
this.values.imageBase64 = response.data.image;
})
},
checkPassword(password) {
if (password.length < 8) {
return this.i18n.register.tips.e7;
}
// 匹配字母
let m1 = /([a-z])+/.test(password);
let m2 = /([A-Z])+/.test(password);
// 匹配数字
let m3 = /([0-9])+/.test(password);
// 匹配特殊字符
let m4 = /[^a-zA-Z0-9]+/.test(password);
if ((m1 | m2) & m3 & m4) {
return "";
} else {
return this.i18n.register.tips.e8;
}
},
_checkMobileLegal() {
// 检测手机号是否正确
return new Promise((resolve, reject) => {
......@@ -382,6 +407,26 @@ export default {
}
return this.values.deviceId
},
onRegisterHandler() {
let c = this.checkPassword(this.values.password);
if (c) {
this.errorTips.p4 = c;
} else {
this.errorTips.p4 = "";
let data = {
deviceId: this.values.deviceId,
token: this.values.token,
mobileNo: this.loginForm.mobileNo,
loginPwd: passwordEncrypt(this.values.password)
};
httpPost({
url: api.otpRegisterAndLogin,
data: data
}).then(response => {
})
}
},
modalCallback() {
this.modalVisiable = false;
if (this.targetPath) {
......@@ -409,8 +454,19 @@ export default {
},
'loginForm.imageValue': function () {
this.errorTips.oe3 = "";
},
'values.password': function () {
this.$set(this.errorTips, 'p4', this.checkPassword(this.values.password));
},
'values.passwordRepeat': function () {
if (this.values.password != this.values.passwordRepeat) {
let message = this.i18n.register.tips.e9;
this.errorTips.p5 = message;
} else {
this.errorTips.p5 = "";
}
},
},
mounted() {
// console.log("PK === ", this.PK)
// console.log("E === ", this.E)
......
......@@ -126,10 +126,44 @@
</div>
<div @click="handlerLogin()" class="login-submit pointer">{{$t('login.login')}}</div>
<div class="login-func">
<div @click="onRegisterHandler()" class="login-func-btn pointer">{{$t('login.register')}}</div>
<div @click="toRegisterPage()" class="login-func-btn pointer">{{$t('login.register')}}</div>
<div @click="onForgetHandler()" class="login-func-btn pointer">{{$t('login.forget')}}</div>
</div>
</div>
<!---->
<div v-if="type == 3" class="login">
<div class="login-tit">
<img v-if="locale == 'zh'" src="@/assets/images/login/login-tit-zh.png">
<img v-if="locale == 'tc'" src="@/assets/images/login/login-tit-tc.png">
<img v-if="locale == 'en'" class="img-en" src="@/assets/images/login/login-tit-en.png">
</div>
<div class="gird-g form">
<div class="pure-u-1 form-item">
<div class="label">
<img src="@/assets/images/register/icon-register-lock.png"> {{$t('register.newPassword')}}
</div>
<div class="ipt-wrap">
<input :placeholder="$t('register.newPasswordPlaceholder')" class="ipt" type="password" v-model="values.password">
</div>
<div class="validator" v-if="errorTips.p4.length > 0 ">
<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p4}}
</div>
</div>
<div class="pure-u-1 form-item">
<div class="label">
<img src="@/assets/images/register/icon-register-lock.png"> {{$t('register.newPasswordSure')}}
</div>
<div class="ipt-wrap">
<input :placeholder="$t('register.newPasswordSurePlaceholder')" class="ipt" type="password" v-model="values.passwordRepeat">
</div>
<div class="validator" v-if="errorTips.p5.length > 0 ">
<img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p5}}
</div>
</div>
</div>
<div @click="onRegisterHandler()" class="login-submit pointer">{{$t('register.sure')}}</div>
</div>
</div>
</div>
</template>
......
......@@ -11,7 +11,7 @@ export default {
data() {
return {
key: 'value',
type: 2, // 1:手机验证 2:输入密码
type: 1, // 1:手机验证 2:输入密码
mobileNoType: "hk",// 选择的手机好类型
mobileTip: {},
mobileOptions: [],
......@@ -300,7 +300,7 @@ export default {
// alert(msg);
},
onRegisterHandler() {
let c = this.checkPassword();
let c = this.checkPassword(this.values.password);
if (c) {
this.errorTips.p4 = c;
} else {
......