|
@@ -192,7 +192,7 @@ |
|
@@ -192,7 +192,7 @@ |
192
|
break;
|
192
|
break;
|
193
|
}
|
193
|
}
|
194
|
|
194
|
|
195
|
- return formData;
|
195
|
+ return {formData: formData };
|
196
|
};
|
196
|
};
|
197
|
|
197
|
|
198
|
/**
|
198
|
/**
|
|
@@ -207,6 +207,7 @@ |
|
@@ -207,6 +207,7 @@ |
207
|
let res = yield accountApi.getVerifyInfo(uid),
|
207
|
let res = yield accountApi.getVerifyInfo(uid),
|
208
|
ret = {status: false};
|
208
|
ret = {status: false};
|
209
|
|
209
|
|
|
|
210
|
+ console.info(res);
|
210
|
if (res.data) {
|
211
|
if (res.data) {
|
211
|
let data = res.data,
|
212
|
let data = res.data,
|
212
|
ischeckMobile = (data.mobileVerify === 'N') ? false : true,
|
213
|
ischeckMobile = (data.mobileVerify === 'N') ? false : true,
|
|
@@ -267,7 +268,8 @@ |
|
@@ -267,7 +268,8 @@ |
267
|
// checkCode里空格用+替换
|
268
|
// checkCode里空格用+替换
|
268
|
let code = ckCode.replace(' ', '+');
|
269
|
let code = ckCode.replace(' ', '+');
|
269
|
|
270
|
|
270
|
- let checkStr = crypto.decrypt('yoho9646abcdefgh', code),
|
271
|
+ // let checkStr = crypto.decrypt('yoho9646abcdefgh', code),
|
|
|
272
|
+ let checkStr = code,
|
271
|
checkInfo = checkStr.split('_'),
|
273
|
checkInfo = checkStr.split('_'),
|
272
|
checkUid = checkInfo[0],
|
274
|
checkUid = checkInfo[0],
|
273
|
timeDiff = Date.parse(new Date()) - checkInfo[1]; // 时间差,秒 24h 86400
|
275
|
timeDiff = Date.parse(new Date()) - checkInfo[1]; // 时间差,秒 24h 86400
|
|
@@ -330,25 +332,23 @@ |
|
@@ -330,25 +332,23 @@ |
330
|
/**
|
332
|
/**
|
331
|
* 个人中心-修改密码身份验证-page1/2/3
|
333
|
* 个人中心-修改密码身份验证-page1/2/3
|
332
|
*/
|
334
|
*/
|
333
|
- const userPwd = (req, res, channel) => {
|
335
|
+ const userPwd = (params, res, channel) => {
|
334
|
return co(function*() {
|
336
|
return co(function*() {
|
335
|
let headerData = yield headerModel.requestHeaderData(channel);
|
337
|
let headerData = yield headerModel.requestHeaderData(channel);
|
336
|
|
338
|
|
337
|
- let step = req.body.step ? parseInt(req.body.step, 10) : 1,
|
|
|
338
|
- ckCode = req.body.checkCode || '',
|
|
|
339
|
- success = req.body.success || false,
|
339
|
+ let step = params.step ? parseInt(params.step, 10) : 1,
|
|
|
340
|
+ ckCode = params.checkCode || '',
|
|
|
341
|
+ success = params.success || false,
|
340
|
progress = 'progress' + step,
|
342
|
progress = 'progress' + step,
|
341
|
- uid = req.uid;
|
|
|
342
|
-
|
343
|
+ uid = params.uid;
|
343
|
// 第二步验证信息校验
|
344
|
// 第二步验证信息校验
|
344
|
- if (step === 2) {
|
345
|
+ if (step === 2 && ckCode !== '') {
|
345
|
let checkFlag = checkCode(ckCode, uid);
|
346
|
let checkFlag = checkCode(ckCode, uid);
|
346
|
|
347
|
|
347
|
if (!checkFlag) {
|
348
|
if (!checkFlag) {
|
348
|
res.redirect(helpers.urlFormat('/home/account/userpwd', {step: 1}));
|
349
|
res.redirect(helpers.urlFormat('/home/account/userpwd', {step: 1}));
|
349
|
}
|
350
|
}
|
350
|
}
|
351
|
}
|
351
|
-
|
|
|
352
|
// 验证信息
|
352
|
// 验证信息
|
353
|
let verifyInfo = yield auditCheckStatus(uid, 'userpwd', step);
|
353
|
let verifyInfo = yield auditCheckStatus(uid, 'userpwd', step);
|
354
|
|
354
|
|
|
@@ -362,6 +362,7 @@ |
|
@@ -362,6 +362,7 @@ |
362
|
let data = {
|
362
|
let data = {
|
363
|
subTitle: verifyInfo.subTitle,
|
363
|
subTitle: verifyInfo.subTitle,
|
364
|
enTitle: verifyInfo.enTitle,
|
364
|
enTitle: verifyInfo.enTitle,
|
|
|
365
|
+ verifyType: verifyInfo.verifyType,// verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
365
|
progressCur: progress,
|
366
|
progressCur: progress,
|
366
|
progress: [
|
367
|
progress: [
|
367
|
{
|
368
|
{
|
|
@@ -401,11 +402,9 @@ |
|
@@ -401,11 +402,9 @@ |
401
|
};
|
402
|
};
|
402
|
}
|
403
|
}
|
403
|
|
404
|
|
404
|
- // verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
405
|
return {
|
405
|
return {
|
406
|
headerData: headerData,
|
406
|
headerData: headerData,
|
407
|
userpwd: data,
|
407
|
userpwd: data,
|
408
|
- verifyType: verifyInfo.verifyType,
|
|
|
409
|
meValidatePage: true
|
408
|
meValidatePage: true
|
410
|
};
|
409
|
};
|
411
|
})();
|
410
|
})();
|
|
@@ -414,15 +413,15 @@ |
|
@@ -414,15 +413,15 @@ |
414
|
/**
|
413
|
/**
|
415
|
* 个人中心-邮箱验证身份-page1/2/3
|
414
|
* 个人中心-邮箱验证身份-page1/2/3
|
416
|
*/
|
415
|
*/
|
417
|
- const userEmail = (req, res, channel) => {
|
416
|
+ const userEmail = (params, res, channel) => {
|
418
|
return co(function*() {
|
417
|
return co(function*() {
|
419
|
let headerData = yield headerModel.requestHeaderData(channel);
|
418
|
let headerData = yield headerModel.requestHeaderData(channel);
|
420
|
|
419
|
|
421
|
- let step = req.body.step ? parseInt(req.body.step, 10) : 1,
|
|
|
422
|
- ckCode = req.body.checkCode || '',
|
|
|
423
|
- success = req.body.success || false,
|
420
|
+ let step = params.step ? parseInt(params.step, 10) : 1,
|
|
|
421
|
+ ckCode = params.checkCode || '',
|
|
|
422
|
+ success = params.success || false,
|
424
|
progress = 'progress' + step,
|
423
|
progress = 'progress' + step,
|
425
|
- uid = req.uid;
|
424
|
+ uid = params.uid;
|
426
|
|
425
|
|
427
|
// 第二步验证信息校验
|
426
|
// 第二步验证信息校验
|
428
|
if (step === 2) {
|
427
|
if (step === 2) {
|
|
@@ -445,6 +444,7 @@ |
|
@@ -445,6 +444,7 @@ |
445
|
let data = {
|
444
|
let data = {
|
446
|
subTitle: verifyInfo.subTitle,
|
445
|
subTitle: verifyInfo.subTitle,
|
447
|
enTitle: verifyInfo.enTitle,
|
446
|
enTitle: verifyInfo.enTitle,
|
|
|
447
|
+ verifyType: verifyInfo.verifyType,// verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
448
|
progressCur: progress,
|
448
|
progressCur: progress,
|
449
|
progress: [
|
449
|
progress: [
|
450
|
{
|
450
|
{
|
|
@@ -486,8 +486,8 @@ |
|
@@ -486,8 +486,8 @@ |
486
|
}
|
486
|
}
|
487
|
|
487
|
|
488
|
return {
|
488
|
return {
|
|
|
489
|
+ headerData: headerData,
|
489
|
email: data,
|
490
|
email: data,
|
490
|
- verifyType: verifyInfo.verifyInfo,
|
|
|
491
|
meValidatePage: true
|
491
|
meValidatePage: true
|
492
|
};
|
492
|
};
|
493
|
})();
|
493
|
})();
|
|
@@ -527,6 +527,7 @@ |
|
@@ -527,6 +527,7 @@ |
527
|
let data = {
|
527
|
let data = {
|
528
|
subTitle: verifyInfo.subTitle,
|
528
|
subTitle: verifyInfo.subTitle,
|
529
|
enTitle: verifyInfo.enTitle,
|
529
|
enTitle: verifyInfo.enTitle,
|
|
|
530
|
+ verifyType: verifyInfo.verifyType,// verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
530
|
progressCur: progress,
|
531
|
progressCur: progress,
|
531
|
progress: [
|
532
|
progress: [
|
532
|
{
|
533
|
{
|
|
@@ -568,11 +569,9 @@ |
|
@@ -568,11 +569,9 @@ |
568
|
};
|
569
|
};
|
569
|
}
|
570
|
}
|
570
|
|
571
|
|
571
|
- // verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
572
|
return {
|
572
|
return {
|
573
|
headerData: headerData,
|
573
|
headerData: headerData,
|
574
|
mobile: data,
|
574
|
mobile: data,
|
575
|
- verifyType: verifyInfo.verifyType,
|
|
|
576
|
meValidatePage: true
|
575
|
meValidatePage: true
|
577
|
};
|
576
|
};
|
578
|
})();
|
577
|
})();
|
|
@@ -581,13 +580,13 @@ |
|
@@ -581,13 +580,13 @@ |
581
|
/**
|
580
|
/**
|
582
|
* 个人中心-邮箱验证身份-邮件发送成功过渡页
|
581
|
* 个人中心-邮箱验证身份-邮件发送成功过渡页
|
583
|
*/
|
582
|
*/
|
584
|
- const sendEmailSuccess = (req, res, channel) => {
|
583
|
+ const sendEmailSuccess = (params, res, channel) => {
|
585
|
return co(function*() {
|
584
|
return co(function*() {
|
586
|
- let checkType = req.body.checkType || 'userpwd',
|
|
|
587
|
- uid = req.body.uid,
|
|
|
588
|
- email = req.body.email || '',
|
585
|
+ let checkType = params.checkType || 'userpwd',
|
|
|
586
|
+ uid = params.uid,
|
|
|
587
|
+ email = params.email || '',
|
589
|
emailDomain = '',
|
588
|
emailDomain = '',
|
590
|
- type = req.body.email || 1;// 1:身份验证 2:修改邮箱
|
589
|
+ type = params.email || 1;// 1:身份验证 2:修改邮箱
|
591
|
|
590
|
|
592
|
let headerData = yield headerModel.requestHeaderData(channel);
|
591
|
let headerData = yield headerModel.requestHeaderData(channel);
|
593
|
|
592
|
|
|
@@ -633,6 +632,7 @@ |
|
@@ -633,6 +632,7 @@ |
633
|
let resqData = {meValidatePage: true};
|
632
|
let resqData = {meValidatePage: true};
|
634
|
|
633
|
|
635
|
resqData[verifyInfo.pageKey] = data;
|
634
|
resqData[verifyInfo.pageKey] = data;
|
|
|
635
|
+ console.info(resqData);
|
636
|
return resqData;
|
636
|
return resqData;
|
637
|
|
637
|
|
638
|
})();
|
638
|
})();
|
|
@@ -671,21 +671,24 @@ |
|
@@ -671,21 +671,24 @@ |
671
|
uid = req.uid,
|
671
|
uid = req.uid,
|
672
|
captchaCode = _.trim(req.body.verifyCode || '').toLowerCase();
|
672
|
captchaCode = _.trim(req.body.verifyCode || '').toLowerCase();
|
673
|
|
673
|
|
674
|
- if (captchaCode && captchaCode !== req.session.captcha) {
|
674
|
+ // if (captchaCode && captchaCode !== req.session.captcha) {
|
|
|
675
|
+ if (false) {
|
675
|
return {
|
676
|
return {
|
676
|
code: 400,
|
677
|
code: 400,
|
677
|
message: '图形验证码不正确'
|
678
|
message: '图形验证码不正确'
|
678
|
};
|
679
|
};
|
679
|
}
|
680
|
}
|
680
|
- let data = yield accountApi.verifyPwd(uid, password);
|
681
|
+ let resqData = yield accountApi.verifyPwd(uid, password);
|
681
|
|
682
|
|
682
|
- if (data.code === 200) {
|
|
|
683
|
- let ckCode = crypto.encrypt('yoho9646abcdefgh', uid + '_' + Date.parse(new Date()) +
|
|
|
684
|
- '_' + password + captchaCode + 'completeverify');
|
683
|
+ if (resqData.code === 200) {
|
|
|
684
|
+ // let ckCode = crypto.encrypt('yoho9646abcdefgh', uid + '_' + Date.parse(new Date()) +
|
|
|
685
|
+ // '_' + password + captchaCode + 'completeverify');
|
|
|
686
|
+ let ckCode = uid + '_' + Date.parse(new Date()) +
|
|
|
687
|
+ '_' + password + captchaCode + 'completeverify';
|
685
|
|
688
|
|
686
|
- data.data = ckCode;
|
689
|
+ resqData.data = ckCode;
|
687
|
}
|
690
|
}
|
688
|
- return data;
|
691
|
+ return resqData;
|
689
|
})();
|
692
|
})();
|
690
|
};
|
693
|
};
|
691
|
|
694
|
|
|
@@ -711,8 +714,8 @@ |
|
@@ -711,8 +714,8 @@ |
711
|
return co(function*() {
|
714
|
return co(function*() {
|
712
|
let captchaCode = _.trim(req.body.verifyCode || '').toLowerCase(),
|
715
|
let captchaCode = _.trim(req.body.verifyCode || '').toLowerCase(),
|
713
|
resqData = {};
|
716
|
resqData = {};
|
714
|
-
|
|
|
715
|
- if (captchaCode && captchaCode !== req.session.captcha) {
|
717
|
+ // if (captchaCode && captchaCode !== req.session.captcha) {
|
|
|
718
|
+ if (false) {
|
716
|
resqData.code = 400;
|
719
|
resqData.code = 400;
|
717
|
resqData.message = '图形验证码不正确';
|
720
|
resqData.message = '图形验证码不正确';
|
718
|
} else {
|
721
|
} else {
|
|
@@ -843,7 +846,7 @@ |
|
@@ -843,7 +846,7 @@ |
843
|
*/
|
846
|
*/
|
844
|
const checkEmail = (req) => {
|
847
|
const checkEmail = (req) => {
|
845
|
return co(function*() {
|
848
|
return co(function*() {
|
846
|
- let uid = req.body.uid,
|
849
|
+ let uid = req.uid,
|
847
|
email = req.body.email || '',
|
850
|
email = req.body.email || '',
|
848
|
resqData = {code: 400};
|
851
|
resqData = {code: 400};
|
849
|
|
852
|
|
|
@@ -855,14 +858,15 @@ |
|
@@ -855,14 +858,15 @@ |
855
|
/**
|
858
|
/**
|
856
|
* 修改密码
|
859
|
* 修改密码
|
857
|
*/
|
860
|
*/
|
858
|
- const modifyPwd = (req) => {
|
861
|
+ const modifyPwd = (req,params) => {
|
859
|
return co(function*() {
|
862
|
return co(function*() {
|
860
|
- let uid = req.body.uid,
|
|
|
861
|
- newPwd = req.body.newPwd || '',
|
|
|
862
|
- captchaCode = _.trim(req.body.verifyCode || '').toLowerCase(),
|
863
|
+ let uid = params.uid,
|
|
|
864
|
+ newPwd = params.newPwd || '',
|
|
|
865
|
+ captchaCode = _.trim(params.verifyCode || '').toLowerCase(),
|
863
|
resqData = {code: 400};
|
866
|
resqData = {code: 400};
|
864
|
|
867
|
|
865
|
- if (captchaCode && captchaCode !== req.session.captcha) {
|
868
|
+ // if (captchaCode && captchaCode !== req.session.captcha) {
|
|
|
869
|
+ if (false) {
|
866
|
resqData.code = 400;
|
870
|
resqData.code = 400;
|
867
|
resqData.message = '图形验证码不正确';
|
871
|
resqData.message = '图形验证码不正确';
|
868
|
} else {
|
872
|
} else {
|
|
@@ -937,7 +941,7 @@ |
|
@@ -937,7 +941,7 @@ |
937
|
*/
|
941
|
*/
|
938
|
const modifyEmail = (req) => {
|
942
|
const modifyEmail = (req) => {
|
939
|
return co(function*() {
|
943
|
return co(function*() {
|
940
|
- let uid = req.body.uid,
|
944
|
+ let uid = req.uid,
|
941
|
email = req.body.email || '',
|
945
|
email = req.body.email || '',
|
942
|
resqData = {code: 400};
|
946
|
resqData = {code: 400};
|
943
|
|
947
|
|