1
Showing
4 changed files
with
97 additions
and
5 deletions
... | @@ -18,6 +18,8 @@ module.exports = { | ... | @@ -18,6 +18,8 @@ module.exports = { |
18 | changePassword : "/pingan_hklife_webapi/password/change", | 18 | changePassword : "/pingan_hklife_webapi/password/change", |
19 | // 短信验证码登录 | 19 | // 短信验证码登录 |
20 | otpLogin : "/pingan_hklife_webapi/user/otpLogin", | 20 | otpLogin : "/pingan_hklife_webapi/user/otpLogin", |
21 | // 短信验证码登录 | ||
22 | otpRegisterAndLogin : "/pingan_hklife_webapi/user/otpRegisterAndLogin", | ||
21 | // 找回密码:定位用户信息 | 23 | // 找回密码:定位用户信息 |
22 | locateUserInfo : "/pingan_hklife_webapi/reset/locateUserInfo", | 24 | locateUserInfo : "/pingan_hklife_webapi/reset/locateUserInfo", |
23 | // 找回密码:发送验证码 | 25 | // 找回密码:发送验证码 | ... | ... |
... | @@ -57,6 +57,9 @@ export default { | ... | @@ -57,6 +57,9 @@ export default { |
57 | oe1: "", // 账号 | 57 | oe1: "", // 账号 |
58 | oe2: "", // 短信验证码 | 58 | oe2: "", // 短信验证码 |
59 | oe3: "", // 图像验证码 | 59 | oe3: "", // 图像验证码 |
60 | // 注册 | ||
61 | p4: "", | ||
62 | p5: "" | ||
60 | }, | 63 | }, |
61 | modalVisiable: false, | 64 | modalVisiable: false, |
62 | targetPath: "", | 65 | targetPath: "", |
... | @@ -96,7 +99,7 @@ export default { | ... | @@ -96,7 +99,7 @@ export default { |
96 | onSubmitHandler() { | 99 | onSubmitHandler() { |
97 | 100 | ||
98 | }, | 101 | }, |
99 | onRegisterHandler() { | 102 | toRegisterPage() { |
100 | this.$router.push({ | 103 | this.$router.push({ |
101 | path: "/register" | 104 | path: "/register" |
102 | }); | 105 | }); |
... | @@ -194,6 +197,7 @@ export default { | ... | @@ -194,6 +197,7 @@ export default { |
194 | this.showModal(message, "info"); | 197 | this.showModal(message, "info"); |
195 | }, | 198 | }, |
196 | _showLoginErrorMessage(response) { | 199 | _showLoginErrorMessage(response) { |
200 | // response.returnCode = "GS_RESETPWD_ERROR_NOUSERINFO"; | ||
197 | switch (response.returnCode) { | 201 | switch (response.returnCode) { |
198 | case "SMS_ERROR_006": | 202 | case "SMS_ERROR_006": |
199 | // 短信验证码不正确 | 203 | // 短信验证码不正确 |
... | @@ -208,6 +212,10 @@ export default { | ... | @@ -208,6 +212,10 @@ export default { |
208 | // 登录错误4次、5次 | 212 | // 登录错误4次、5次 |
209 | this.showModal(response.returnMsg, "info"); | 213 | this.showModal(response.returnMsg, "info"); |
210 | return; | 214 | return; |
215 | case "GS_RESETPWD_ERROR_NOUSERINFO": | ||
216 | // 这个是用户OTP验证成功后没有账号导致 | ||
217 | this.type = 3; | ||
218 | break; | ||
211 | default: | 219 | default: |
212 | this.showModal(this.i18n.login.tips.e5, "info"); | 220 | this.showModal(this.i18n.login.tips.e5, "info"); |
213 | break; | 221 | break; |
... | @@ -291,6 +299,23 @@ export default { | ... | @@ -291,6 +299,23 @@ export default { |
291 | this.values.imageBase64 = response.data.image; | 299 | this.values.imageBase64 = response.data.image; |
292 | }) | 300 | }) |
293 | }, | 301 | }, |
302 | checkPassword(password) { | ||
303 | if (password.length < 8) { | ||
304 | return this.i18n.register.tips.e7; | ||
305 | } | ||
306 | // 匹配字母 | ||
307 | let m1 = /([a-z])+/.test(password); | ||
308 | let m2 = /([A-Z])+/.test(password); | ||
309 | // 匹配数字 | ||
310 | let m3 = /([0-9])+/.test(password); | ||
311 | // 匹配特殊字符 | ||
312 | let m4 = /[^a-zA-Z0-9]+/.test(password); | ||
313 | if ((m1 | m2) & m3 & m4) { | ||
314 | return ""; | ||
315 | } else { | ||
316 | return this.i18n.register.tips.e8; | ||
317 | } | ||
318 | }, | ||
294 | _checkMobileLegal() { | 319 | _checkMobileLegal() { |
295 | // 检测手机号是否正确 | 320 | // 检测手机号是否正确 |
296 | return new Promise((resolve, reject) => { | 321 | return new Promise((resolve, reject) => { |
... | @@ -382,6 +407,26 @@ export default { | ... | @@ -382,6 +407,26 @@ export default { |
382 | } | 407 | } |
383 | return this.values.deviceId | 408 | return this.values.deviceId |
384 | }, | 409 | }, |
410 | onRegisterHandler() { | ||
411 | let c = this.checkPassword(this.values.password); | ||
412 | if (c) { | ||
413 | this.errorTips.p4 = c; | ||
414 | } else { | ||
415 | this.errorTips.p4 = ""; | ||
416 | let data = { | ||
417 | deviceId: this.values.deviceId, | ||
418 | token: this.values.token, | ||
419 | mobileNo: this.loginForm.mobileNo, | ||
420 | loginPwd: passwordEncrypt(this.values.password) | ||
421 | }; | ||
422 | httpPost({ | ||
423 | url: api.otpRegisterAndLogin, | ||
424 | data: data | ||
425 | }).then(response => { | ||
426 | |||
427 | }) | ||
428 | } | ||
429 | }, | ||
385 | modalCallback() { | 430 | modalCallback() { |
386 | this.modalVisiable = false; | 431 | this.modalVisiable = false; |
387 | if (this.targetPath) { | 432 | if (this.targetPath) { |
... | @@ -409,7 +454,18 @@ export default { | ... | @@ -409,7 +454,18 @@ export default { |
409 | }, | 454 | }, |
410 | 'loginForm.imageValue': function () { | 455 | 'loginForm.imageValue': function () { |
411 | this.errorTips.oe3 = ""; | 456 | this.errorTips.oe3 = ""; |
412 | } | 457 | }, |
458 | 'values.password': function () { | ||
459 | this.$set(this.errorTips, 'p4', this.checkPassword(this.values.password)); | ||
460 | }, | ||
461 | 'values.passwordRepeat': function () { | ||
462 | if (this.values.password != this.values.passwordRepeat) { | ||
463 | let message = this.i18n.register.tips.e9; | ||
464 | this.errorTips.p5 = message; | ||
465 | } else { | ||
466 | this.errorTips.p5 = ""; | ||
467 | } | ||
468 | }, | ||
413 | }, | 469 | }, |
414 | mounted() { | 470 | mounted() { |
415 | // console.log("PK === ", this.PK) | 471 | // console.log("PK === ", this.PK) | ... | ... |
... | @@ -126,10 +126,44 @@ | ... | @@ -126,10 +126,44 @@ |
126 | </div> | 126 | </div> |
127 | <div @click="handlerLogin()" class="login-submit pointer">{{$t('login.login')}}</div> | 127 | <div @click="handlerLogin()" class="login-submit pointer">{{$t('login.login')}}</div> |
128 | <div class="login-func"> | 128 | <div class="login-func"> |
129 | <div @click="onRegisterHandler()" class="login-func-btn pointer">{{$t('login.register')}}</div> | 129 | <div @click="toRegisterPage()" class="login-func-btn pointer">{{$t('login.register')}}</div> |
130 | <div @click="onForgetHandler()" class="login-func-btn pointer">{{$t('login.forget')}}</div> | 130 | <div @click="onForgetHandler()" class="login-func-btn pointer">{{$t('login.forget')}}</div> |
131 | </div> | 131 | </div> |
132 | </div> | 132 | </div> |
133 | |||
134 | <!----> | ||
135 | <div v-if="type == 3" class="login"> | ||
136 | <div class="login-tit"> | ||
137 | <img v-if="locale == 'zh'" src="@/assets/images/login/login-tit-zh.png"> | ||
138 | <img v-if="locale == 'tc'" src="@/assets/images/login/login-tit-tc.png"> | ||
139 | <img v-if="locale == 'en'" class="img-en" src="@/assets/images/login/login-tit-en.png"> | ||
140 | </div> | ||
141 | <div class="gird-g form"> | ||
142 | <div class="pure-u-1 form-item"> | ||
143 | <div class="label"> | ||
144 | <img src="@/assets/images/register/icon-register-lock.png"> {{$t('register.newPassword')}} | ||
145 | </div> | ||
146 | <div class="ipt-wrap"> | ||
147 | <input :placeholder="$t('register.newPasswordPlaceholder')" class="ipt" type="password" v-model="values.password"> | ||
148 | </div> | ||
149 | <div class="validator" v-if="errorTips.p4.length > 0 "> | ||
150 | <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p4}} | ||
151 | </div> | ||
152 | </div> | ||
153 | <div class="pure-u-1 form-item"> | ||
154 | <div class="label"> | ||
155 | <img src="@/assets/images/register/icon-register-lock.png"> {{$t('register.newPasswordSure')}} | ||
156 | </div> | ||
157 | <div class="ipt-wrap"> | ||
158 | <input :placeholder="$t('register.newPasswordSurePlaceholder')" class="ipt" type="password" v-model="values.passwordRepeat"> | ||
159 | </div> | ||
160 | <div class="validator" v-if="errorTips.p5.length > 0 "> | ||
161 | <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p5}} | ||
162 | </div> | ||
163 | </div> | ||
164 | </div> | ||
165 | <div @click="onRegisterHandler()" class="login-submit pointer">{{$t('register.sure')}}</div> | ||
166 | </div> | ||
133 | </div> | 167 | </div> |
134 | </div> | 168 | </div> |
135 | </template> | 169 | </template> | ... | ... |
... | @@ -11,7 +11,7 @@ export default { | ... | @@ -11,7 +11,7 @@ export default { |
11 | data() { | 11 | data() { |
12 | return { | 12 | return { |
13 | key: 'value', | 13 | key: 'value', |
14 | type: 2, // 1:手机验证 2:输入密码 | 14 | type: 1, // 1:手机验证 2:输入密码 |
15 | mobileNoType: "hk",// 选择的手机好类型 | 15 | mobileNoType: "hk",// 选择的手机好类型 |
16 | mobileTip: {}, | 16 | mobileTip: {}, |
17 | mobileOptions: [], | 17 | mobileOptions: [], |
... | @@ -300,7 +300,7 @@ export default { | ... | @@ -300,7 +300,7 @@ export default { |
300 | // alert(msg); | 300 | // alert(msg); |
301 | }, | 301 | }, |
302 | onRegisterHandler() { | 302 | onRegisterHandler() { |
303 | let c = this.checkPassword(); | 303 | let c = this.checkPassword(this.values.password); |
304 | if (c) { | 304 | if (c) { |
305 | this.errorTips.p4 = c; | 305 | this.errorTips.p4 = c; |
306 | } else { | 306 | } else { | ... | ... |
-
Please register or sign in to post a comment