9286383c by joe

登錄、註冊功能修改

1 parent 00af06c9
...@@ -217,6 +217,7 @@ module.exports = { ...@@ -217,6 +217,7 @@ module.exports = {
217 e5: "Invalidate account or password, please re-enter", 217 e5: "Invalidate account or password, please re-enter",
218 e6: "Your password has been mistyped 4 times. Your account will be locked soon. Please retrieve your password!", 218 e6: "Your password has been mistyped 4 times. Your account will be locked soon. Please retrieve your password!",
219 e7: "Your password has been mistyped 5 times. You can't log in again in 24 hours!", 219 e7: "Your password has been mistyped 5 times. You can't log in again in 24 hours!",
220 e8: "The mobile no. has not been registered, please register before using!",
220 oe0: "Invalidate mobile no. , please re-enter", 221 oe0: "Invalidate mobile no. , please re-enter",
221 oe1: "Please get SMS verification code first", 222 oe1: "Please get SMS verification code first",
222 oe2: "Please enter the picture verification code", 223 oe2: "Please enter the picture verification code",
...@@ -267,6 +268,8 @@ module.exports = { ...@@ -267,6 +268,8 @@ module.exports = {
267 e10: "Verification code was Expired", 268 e10: "Verification code was Expired",
268 e11: "Registration failed, please contact the staff", 269 e11: "Registration failed, please contact the staff",
269 e12: "Success", 270 e12: "Success",
271 e13: "The name can't not contain numbers, special numbers",
272 e14: "Please enter your name"
270 } 273 }
271 }, 274 },
272 passwordCheck: { 275 passwordCheck: {
......
...@@ -219,6 +219,7 @@ module.exports = { ...@@ -219,6 +219,7 @@ module.exports = {
219 e5: "賬號或密碼不正確", 219 e5: "賬號或密碼不正確",
220 e6: "您的密碼已輸錯4次,帳戶即將被鎖定,請找回密碼!", 220 e6: "您的密碼已輸錯4次,帳戶即將被鎖定,請找回密碼!",
221 e7: "您的密碼已輸錯5次,24小時內無法再登入!", 221 e7: "您的密碼已輸錯5次,24小時內無法再登入!",
222 e8: "您的手機號還未註冊,請註冊後再使用!",
222 oe0: "請輸入正確的手機號", 223 oe0: "請輸入正確的手機號",
223 oe1: "請先獲取短信驗證碼", 224 oe1: "請先獲取短信驗證碼",
224 oe2: "請輸入圖片驗證碼", 225 oe2: "請輸入圖片驗證碼",
...@@ -266,7 +267,9 @@ module.exports = { ...@@ -266,7 +267,9 @@ module.exports = {
266 e9: "兩次密碼不一致,請確認後重新輸入", 267 e9: "兩次密碼不一致,請確認後重新輸入",
267 e10: "驗證碼過期,請重新申請驗證碼", 268 e10: "驗證碼過期,請重新申請驗證碼",
268 e11: "註冊失敗,請聯繫工作人員", 269 e11: "註冊失敗,請聯繫工作人員",
269 e12: "註冊成功" 270 e12: "註冊成功",
271 e13: "姓名不能包含數字、特殊號碼",
272 e14: "請輸入您的姓名"
270 }, 273 },
271 accountPlaceholder:"請設置用戶名稱", 274 accountPlaceholder:"請設置用戶名稱",
272 }, 275 },
......
...@@ -219,6 +219,7 @@ module.exports = { ...@@ -219,6 +219,7 @@ module.exports = {
219 e5: "账号或密码不正确", 219 e5: "账号或密码不正确",
220 e6: "您的密码已输错4次,账户即将被锁定,请找回密码!", 220 e6: "您的密码已输错4次,账户即将被锁定,请找回密码!",
221 e7: "您的密码已输错5次, 24小时内无法再登录!", 221 e7: "您的密码已输错5次, 24小时内无法再登录!",
222 e8: "您的手机号还未注册,请注册后再使用!",
222 oe0: "请输入正确的手机号", 223 oe0: "请输入正确的手机号",
223 oe1: "请先获取短信验证码", 224 oe1: "请先获取短信验证码",
224 oe2: "请输入图片验证码", 225 oe2: "请输入图片验证码",
...@@ -269,7 +270,9 @@ module.exports = { ...@@ -269,7 +270,9 @@ module.exports = {
269 e9: "两次输入的密码不一致", 270 e9: "两次输入的密码不一致",
270 e10: "验证码过期,请重新申请验证码", 271 e10: "验证码过期,请重新申请验证码",
271 e11: "注册失败,请联系工作人员", 272 e11: "注册失败,请联系工作人员",
272 e12: "註冊成功" 273 e12: "注册成功",
274 e13: "姓名不能包含数字、特殊字符",
275 e14: "請輸入您的姓名"
273 }, 276 },
274 accountPlaceholder:"请设置用户名称", 277 accountPlaceholder:"请设置用户名称",
275 }, 278 },
......
...@@ -128,7 +128,8 @@ export default { ...@@ -128,7 +128,8 @@ export default {
128 pwdLoginDisabledOneAccountCenterOff() { 128 pwdLoginDisabledOneAccountCenterOff() {
129 let b1 = !this.loginCheck.agreeProtocol; 129 let b1 = !this.loginCheck.agreeProtocol;
130 let b2 = !this.loginForm.userId; 130 let b2 = !this.loginForm.userId;
131 let b3 = !this.loginForm.password; 131 // let b3 = !this.loginForm.password;
132 let b3 = false;
132 let b4 = !this.loginForm.otp; 133 let b4 = !this.loginForm.otp;
133 134
134 let b = b1 || b2 || b3 || b4; 135 let b = b1 || b2 || b3 || b4;
...@@ -266,7 +267,7 @@ export default { ...@@ -266,7 +267,7 @@ export default {
266 }, 267 },
267 // 不接入一账通登陆 268 // 不接入一账通登陆
268 pwdLoginWhenOneAccountCenterOff() { 269 pwdLoginWhenOneAccountCenterOff() {
269 if (this.pwdLoginDisabled) { 270 if (this.pwdLoginDisabledOneAccountCenterOff) {
270 return; 271 return;
271 } 272 }
272 if (this.loading) { 273 if (this.loading) {
...@@ -275,7 +276,7 @@ export default { ...@@ -275,7 +276,7 @@ export default {
275 this.loading = true; 276 this.loading = true;
276 let data = { 277 let data = {
277 account: this.loginForm.userId, 278 account: this.loginForm.userId,
278 password: this.loginForm.password, 279 // password: this.loginForm.password,
279 otp: this.loginForm.otp 280 otp: this.loginForm.otp
280 }; 281 };
281 httpPost({ 282 httpPost({
...@@ -289,7 +290,8 @@ export default { ...@@ -289,7 +290,8 @@ export default {
289 this.loading = false; 290 this.loading = false;
290 switch (e.code) { 291 switch (e.code) {
291 case 404: 292 case 404:
292 this.errorTips.e2 = this.i18n.login.tips.e5; 293 // this.errorTips.e2 = this.i18n.login.tips.e5;
294 this.errorTips.e1 = this.i18n.login.tips.e8;
293 break; 295 break;
294 case 1104: 296 case 1104:
295 this.errorTips.oe2 = this.i18n.login.tips.oe4; 297 this.errorTips.oe2 = this.i18n.login.tips.oe4;
......
...@@ -92,7 +92,8 @@ ...@@ -92,7 +92,8 @@
92 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e1}} 92 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e1}}
93 </div> 93 </div>
94 </div> 94 </div>
95 <div class="pure-u-1 form-item"> 95 <!-- 第二版,不需要密码-->
96 <!-- <div class="pure-u-1 form-item">
96 <div class="label"> 97 <div class="label">
97 <img src="@/assets/images/login/icon-login-password.png"> {{$t('login.password')}} 98 <img src="@/assets/images/login/icon-login-password.png"> {{$t('login.password')}}
98 </div> 99 </div>
...@@ -102,7 +103,7 @@ ...@@ -102,7 +103,7 @@
102 <div class="validator" v-if="errorTips.e2.length > 0 "> 103 <div class="validator" v-if="errorTips.e2.length > 0 ">
103 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e2}} 104 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e2}}
104 </div> 105 </div>
105 </div> 106 </div> -->
106 <div class="pure-u-1 form-item"> 107 <div class="pure-u-1 form-item">
107 <div class="label"> 108 <div class="label">
108 <img src="@/assets/images/login/icon-login-phone.png"> {{$t('login.SMSVerificationCode')}} 109 <img src="@/assets/images/login/icon-login-phone.png"> {{$t('login.SMSVerificationCode')}}
......
...@@ -7,7 +7,7 @@ import { mapState } from "vuex"; ...@@ -7,7 +7,7 @@ import { mapState } from "vuex";
7 import api from "@/api/api"; 7 import api from "@/api/api";
8 import { httpGet, httpPost } from "@/api/fetch-api.js"; 8 import { httpGet, httpPost } from "@/api/fetch-api.js";
9 9
10 import { contactMethodCheck, checkVerifyCode } from "@utils/utils.js"; 10 import { contactMethodCheck, checkVerifyCode, checkName } from "@utils/utils.js";
11 11
12 import modalComp from "@/components/modal-comp/modal-comp.vue"; 12 import modalComp from "@/components/modal-comp/modal-comp.vue";
13 import modalSimpleComp from "@/components/modal-simple-comp/modal-simple-comp.vue"; 13 import modalSimpleComp from "@/components/modal-simple-comp/modal-simple-comp.vue";
...@@ -105,15 +105,19 @@ export default { ...@@ -105,15 +105,19 @@ export default {
105 return b1 || b2 || b3 || b4; 105 return b1 || b2 || b3 || b4;
106 }, 106 },
107 registerDisabledV2() { 107 registerDisabledV2() {
108 let b1 = 108 // let b1 =
109 !this.values.password || this.checkPassword(this.values.password) 109 // !this.values.password || this.checkPassword(this.values.password)
110 ? true 110 // ? true
111 : false; 111 // : false;
112 let b2 = 112 // let b2 =
113 this.values.passwordRepeat != this.values.password ? true : false; 113 // this.values.passwordRepeat != this.values.password ? true : false;
114 // 不需要密码校验了
115 let b1 = false;
116 let b2 = false;
114 let b3 = !this.registerCheck.agreeProtocol; 117 let b3 = !this.registerCheck.agreeProtocol;
115 let b4 = !this.registerForm.mobileNo ? true : false; 118 let b4 = !this.registerForm.mobileNo ? true : false;
116 return b1 || b2 || b3 || b4; 119 let b5 = !this.registerForm.userId ? true : false;
120 return b1 || b2 || b3 || b4 || b5;
117 }, 121 },
118 submitDisabled() { 122 submitDisabled() {
119 let b1 = 123 let b1 =
...@@ -257,7 +261,7 @@ export default { ...@@ -257,7 +261,7 @@ export default {
257 let i18n = this.$i18n.messages[this.$i18n.locale] || {}; 261 let i18n = this.$i18n.messages[this.$i18n.locale] || {};
258 let msg = i18n.register.coutTips; 262 let msg = i18n.register.coutTips;
259 _this.times.tip = msg.replace("{second}", _this.times.remain); 263 _this.times.tip = msg.replace("{second}", _this.times.remain);
260 this.times.interval = setInterval(function() { 264 this.times.interval = setInterval(function () {
261 if (_this.times.remain <= 0) { 265 if (_this.times.remain <= 0) {
262 clearInterval(_this.times.interval); 266 clearInterval(_this.times.interval);
263 _this.times.interval = 0; 267 _this.times.interval = 0;
...@@ -300,17 +304,37 @@ export default { ...@@ -300,17 +304,37 @@ export default {
300 } 304 }
301 this._checkMobileLegal(); 305 this._checkMobileLegal();
302 }, 306 },
307 checkNameActivity() {
308 this.errorTips.e1 = "";
309 if (!this.registerForm.userId) {
310 this.errorTips.e1 = this.i18n.register.tips.e14;
311 return false;
312 }
313 if (!checkName(this.registerForm.userId)) {
314 this.errorTips.e1 = this.i18n.register.tips.e13;
315 return false;
316 }
317 return true;
318 },
303 registerV2Handler() { 319 registerV2Handler() {
304 if (this.registerDisabledV2) { 320 if (this.registerDisabledV2) {
305 return; 321 return;
306 } 322 }
323 if (!this.checkNameActivity()) {
324 return;
325 }
326 if (!checkVerifyCode(this.registerForm.otp)) {
327 this._showOTPTip();
328 return;
329 }
307 if (this.loading) { 330 if (this.loading) {
308 return; 331 return;
309 } 332 }
310 this._checkMobileLegal().then(() => { 333 this._checkMobileLegal().then(() => {
311 let data = { 334 let data = {
312 account: this.registerForm.mobileNo, 335 account: this.registerForm.mobileNo,
313 password: this.values.password 336 userName: this.registerForm.userId,
337 otp: this.registerForm.otp
314 }; 338 };
315 this.loading = true; 339 this.loading = true;
316 httpPost({ 340 httpPost({
...@@ -329,6 +353,9 @@ export default { ...@@ -329,6 +353,9 @@ export default {
329 let message = this.i18n.register.tips.e5; 353 let message = this.i18n.register.tips.e5;
330 this.errorTips.p1 = message; 354 this.errorTips.p1 = message;
331 break; 355 break;
356 case 1104:
357 this.errorTips.p2 = this.i18n.login.tips.oe4;
358 break;
332 } 359 }
333 }); 360 });
334 }); 361 });
...@@ -582,8 +609,8 @@ export default { ...@@ -582,8 +609,8 @@ export default {
582 // }); 609 // });
583 // alert("注册成功") 610 // alert("注册成功")
584 }, 611 },
585 onForgetHandler() {}, 612 onForgetHandler() { },
586 onLoginTypeHandler(val) {}, 613 onLoginTypeHandler(val) { },
587 initData() { 614 initData() {
588 if (this.userInfo && (this.userInfo.sid || this.userInfo.name)) { 615 if (this.userInfo && (this.userInfo.sid || this.userInfo.name)) {
589 this.$router.push({ 616 this.$router.push({
...@@ -605,7 +632,39 @@ export default { ...@@ -605,7 +632,39 @@ export default {
605 path: this.targetPath 632 path: this.targetPath
606 }); 633 });
607 } 634 }
635 },
636
637 sendOTPWhenOneAccountCenterOff() {
638 // 发送短信验证码
639 let mobileNo = this.registerForm.mobileNo;
640 let m1 = contactMethodCheck('hkmobile', mobileNo);
641 let m2 = contactMethodCheck('mobile', mobileNo);
642 if (!m1 && !m2) {
643 this._showMobileNoIllegalTip();
644 return;
645 }
646 if (this.times.remain > 0) {
647 return;
608 } 648 }
649 let data = {
650 mobile: mobileNo,
651 lan: this.locale,
652 scene: "register"
653 }
654 httpPost({
655 url: api.refreshSmgOtp,
656 data: data
657 }).then(res => {
658 this._startTimeClick();
659 }).catch(e => {
660 switch (e.code) {
661 case 1103:
662 this.errorTips.p1 = this.i18n.register.tips.e5
663 break;
664 }
665 console.error(e);
666 })
667 },
609 }, 668 },
610 mounted() { 669 mounted() {
611 window.showSuccessMessage = this._showSuccessMessage; 670 window.showSuccessMessage = this._showSuccessMessage;
...@@ -620,19 +679,22 @@ export default { ...@@ -620,19 +679,22 @@ export default {
620 } 679 }
621 }); 680 });
622 }, 681 },
623 "registerForm.mobileNo": function() { 682 "registerForm.userId": function () {
683 this.errorTips.e1 = "";
684 },
685 "registerForm.mobileNo": function () {
624 this.errorTips.p1 = ""; 686 this.errorTips.p1 = "";
625 }, 687 },
626 "registerForm.opt": function() { 688 "registerForm.otp": function () {
627 this.errorTips.p2 = ""; 689 this.errorTips.p2 = "";
628 }, 690 },
629 "registerForm.imageValue": function() { 691 "registerForm.imageValue": function () {
630 this.errorTips.p3 = ""; 692 this.errorTips.p3 = "";
631 }, 693 },
632 "values.password": function() { 694 "values.password": function () {
633 this.$set(this.errorTips, "p4", this.checkPassword(this.values.password)); 695 this.$set(this.errorTips, "p4", this.checkPassword(this.values.password));
634 }, 696 },
635 "values.passwordRepeat": function() { 697 "values.passwordRepeat": function () {
636 if (this.values.password != this.values.passwordRepeat) { 698 if (this.values.password != this.values.passwordRepeat) {
637 this._showPasswordNotTheSameTips(); 699 this._showPasswordNotTheSameTips();
638 } else { 700 } else {
...@@ -640,19 +702,19 @@ export default { ...@@ -640,19 +702,19 @@ export default {
640 } 702 }
641 } 703 }
642 }, 704 },
643 beforeDestroy() {}, 705 beforeDestroy() { },
644 created() { 706 created() {
645 this.initData(); 707 this.initData();
646 try { 708 try {
647 this.$root.eventBus.$off("/register"); 709 this.$root.eventBus.$off("/register");
648 } catch (e) {} 710 } catch (e) { }
649 this.$root.eventBus.$on("/register", () => { 711 this.$root.eventBus.$on("/register", () => {
650 this.type = 1; 712 this.type = 1;
651 }); 713 });
652 this.$root.eventBus.$on("langChange", () => { 714 this.$root.eventBus.$on("langChange", () => {
653 try { 715 try {
654 this.initData(); 716 this.initData();
655 } catch (e) {} 717 } catch (e) { }
656 }); 718 });
657 } 719 }
658 }; 720 };
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
6 <!-- 会员协议 --> 6 <!-- 会员协议 -->
7 <modal-protocol-comp :visible="modalProtocolVisiable" :overlay="closeModal" :close="closeModal"></modal-protocol-comp> 7 <modal-protocol-comp :visible="modalProtocolVisiable" :overlay="closeModal" :close="closeModal"></modal-protocol-comp>
8 <div class="ebg"></div> 8 <div class="ebg"></div>
9 <!-- 一账通模板-->
9 <div class="content" v-if="!oneAccountCenterOff"> 10 <div class="content" v-if="!oneAccountCenterOff">
10 <div class="top-space"></div> 11 <div class="top-space"></div>
11 <div class="step"> 12 <div class="step">
...@@ -125,7 +126,7 @@ ...@@ -125,7 +126,7 @@
125 </div> 126 </div>
126 </div> 127 </div>
127 128
128 <!-- OPT --> 129 <!-- 非一账通 -->
129 <div class="content" v-else> 130 <div class="content" v-else>
130 <div class="top-space"></div> 131 <div class="top-space"></div>
131 <div class="box"> 132 <div class="box">
...@@ -138,14 +139,14 @@ ...@@ -138,14 +139,14 @@
138 <!-- 账号 --> 139 <!-- 账号 -->
139 <div class="pure-u-1 form-item"> 140 <div class="pure-u-1 form-item">
140 <div class="label"> 141 <div class="label">
141 <img src="@/assets/images/login/icon-login-user.png"> {{$t('login.account')}} 142 <img src="@/assets/images/login/icon-login-user.png"> {{$t('infomationImprove.t1')}}
142 </div> 143 </div>
143 <div class="ipt-wrap"> 144 <div class="ipt-wrap">
144 <!-- <input v-model="registerForm.userId" :placeholder="$t('register.accountPlaceholder')" class="ipt" :class="{ err : errorTips.e1.length > 0 }" type="text" @blur="userIdLegalCheck"> --> 145 <!-- <input v-model="registerForm.userId" :placeholder="$t('register.accountPlaceholder')" class="ipt" :class="{ err : errorTips.e1.length > 0 }" type="text" @blur="userIdLegalCheck"> -->
145 <input v-model="registerForm.userId" :placeholder="$t('register.accountPlaceholder')" class="ipt" :class="{ err : errorTips.e1.length > 0 }" type="text" > 146 <input v-model="registerForm.userId" :placeholder="$t('register.accountPlaceholder')" class="ipt" :class="{ err : errorTips.e1.length > 0 }" type="text" @blur="checkNameActivity">
146 </div> 147 </div>
147 <div class="validator" v-if="errorTips.p1.length > 0 "> 148 <div class="validator" v-if="errorTips.e1.length > 0 ">
148 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p1}} 149 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.e1}}
149 </div> 150 </div>
150 </div> 151 </div>
151 152
...@@ -178,15 +179,15 @@ ...@@ -178,15 +179,15 @@
178 <img src="@/assets/images/register/icon-register-phone.png"> {{$t('login.SMSVerificationCode')}} 179 <img src="@/assets/images/register/icon-register-phone.png"> {{$t('login.SMSVerificationCode')}}
179 </div> 180 </div>
180 <div class="ipt-wrap"> 181 <div class="ipt-wrap">
181 <div class="ipt ipt2" :class="{ err : errorTips.oe2.length > 0 }"> 182 <div class="ipt ipt2" :class="{ err : errorTips.p2.length > 0 }">
182 <input :placeholder="$t('login.verifyCodePlaceholder')" class="ipt-code" type="text" v-model="registerForm.otp"> 183 <input :placeholder="$t('login.verifyCodePlaceholder')" class="ipt-code" type="text" v-model="registerForm.otp">
183 <!-- <div v-if="times.remain == 0" class="veri-btn pointer" @click="sendOTPWhenOneAccountCenterOff">{{$t('register.verifyCodeGet')}}</div> --> 184 <div v-if="times.remain == 0" class="veri-btn pointer" @click="sendOTPWhenOneAccountCenterOff">{{$t('register.verifyCodeGet')}}</div>
184 <div v-if="times.remain == 0" class="veri-btn pointer" >{{$t('register.verifyCodeGet')}}</div> 185 <!-- <div v-if="times.remain == 0" class="veri-btn pointer" >{{$t('register.verifyCodeGet')}}</div> -->
185 <div v-else class="veri-btn-default">{{times.tip}}</div> 186 <div v-else class="veri-btn-default">{{times.tip}}</div>
186 </div> 187 </div>
187 </div> 188 </div>
188 <div class="validator" v-if="errorTips.oe2.length > 0 "> 189 <div class="validator" v-if="errorTips.p2.length > 0 ">
189 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.oe2}} 190 <img src="@/assets/images/common/icon-notice.png" alt="">{{errorTips.p2}}
190 </div> 191 </div>
191 </div> 192 </div>
192 193
......