...
|
...
|
@@ -192,7 +192,7 @@ |
|
|
break;
|
|
|
}
|
|
|
|
|
|
return formData;
|
|
|
return {formData: formData };
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -207,6 +207,7 @@ |
|
|
let res = yield accountApi.getVerifyInfo(uid),
|
|
|
ret = {status: false};
|
|
|
|
|
|
console.info(res);
|
|
|
if (res.data) {
|
|
|
let data = res.data,
|
|
|
ischeckMobile = (data.mobileVerify === 'N') ? false : true,
|
...
|
...
|
@@ -267,7 +268,8 @@ |
|
|
// checkCode里空格用+替换
|
|
|
let code = ckCode.replace(' ', '+');
|
|
|
|
|
|
let checkStr = crypto.decrypt('yoho9646abcdefgh', code),
|
|
|
// let checkStr = crypto.decrypt('yoho9646abcdefgh', code),
|
|
|
let checkStr = code,
|
|
|
checkInfo = checkStr.split('_'),
|
|
|
checkUid = checkInfo[0],
|
|
|
timeDiff = Date.parse(new Date()) - checkInfo[1]; // 时间差,秒 24h 86400
|
...
|
...
|
@@ -330,25 +332,23 @@ |
|
|
/**
|
|
|
* 个人中心-修改密码身份验证-page1/2/3
|
|
|
*/
|
|
|
const userPwd = (req, res, channel) => {
|
|
|
const userPwd = (params, res, channel) => {
|
|
|
return co(function*() {
|
|
|
let headerData = yield headerModel.requestHeaderData(channel);
|
|
|
|
|
|
let step = req.body.step ? parseInt(req.body.step, 10) : 1,
|
|
|
ckCode = req.body.checkCode || '',
|
|
|
success = req.body.success || false,
|
|
|
let step = params.step ? parseInt(params.step, 10) : 1,
|
|
|
ckCode = params.checkCode || '',
|
|
|
success = params.success || false,
|
|
|
progress = 'progress' + step,
|
|
|
uid = req.uid;
|
|
|
|
|
|
uid = params.uid;
|
|
|
// 第二步验证信息校验
|
|
|
if (step === 2) {
|
|
|
if (step === 2 && ckCode !== '') {
|
|
|
let checkFlag = checkCode(ckCode, uid);
|
|
|
|
|
|
if (!checkFlag) {
|
|
|
res.redirect(helpers.urlFormat('/home/account/userpwd', {step: 1}));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 验证信息
|
|
|
let verifyInfo = yield auditCheckStatus(uid, 'userpwd', step);
|
|
|
|
...
|
...
|
@@ -362,6 +362,7 @@ |
|
|
let data = {
|
|
|
subTitle: verifyInfo.subTitle,
|
|
|
enTitle: verifyInfo.enTitle,
|
|
|
verifyType: verifyInfo.verifyType,// verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
progressCur: progress,
|
|
|
progress: [
|
|
|
{
|
...
|
...
|
@@ -401,11 +402,9 @@ |
|
|
};
|
|
|
}
|
|
|
|
|
|
// verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
return {
|
|
|
headerData: headerData,
|
|
|
userpwd: data,
|
|
|
verifyType: verifyInfo.verifyType,
|
|
|
meValidatePage: true
|
|
|
};
|
|
|
})();
|
...
|
...
|
@@ -414,15 +413,15 @@ |
|
|
/**
|
|
|
* 个人中心-邮箱验证身份-page1/2/3
|
|
|
*/
|
|
|
const userEmail = (req, res, channel) => {
|
|
|
const userEmail = (params, res, channel) => {
|
|
|
return co(function*() {
|
|
|
let headerData = yield headerModel.requestHeaderData(channel);
|
|
|
|
|
|
let step = req.body.step ? parseInt(req.body.step, 10) : 1,
|
|
|
ckCode = req.body.checkCode || '',
|
|
|
success = req.body.success || false,
|
|
|
let step = params.step ? parseInt(params.step, 10) : 1,
|
|
|
ckCode = params.checkCode || '',
|
|
|
success = params.success || false,
|
|
|
progress = 'progress' + step,
|
|
|
uid = req.uid;
|
|
|
uid = params.uid;
|
|
|
|
|
|
// 第二步验证信息校验
|
|
|
if (step === 2) {
|
...
|
...
|
@@ -445,6 +444,7 @@ |
|
|
let data = {
|
|
|
subTitle: verifyInfo.subTitle,
|
|
|
enTitle: verifyInfo.enTitle,
|
|
|
verifyType: verifyInfo.verifyType,// verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
progressCur: progress,
|
|
|
progress: [
|
|
|
{
|
...
|
...
|
@@ -486,8 +486,8 @@ |
|
|
}
|
|
|
|
|
|
return {
|
|
|
headerData: headerData,
|
|
|
email: data,
|
|
|
verifyType: verifyInfo.verifyInfo,
|
|
|
meValidatePage: true
|
|
|
};
|
|
|
})();
|
...
|
...
|
@@ -527,6 +527,7 @@ |
|
|
let data = {
|
|
|
subTitle: verifyInfo.subTitle,
|
|
|
enTitle: verifyInfo.enTitle,
|
|
|
verifyType: verifyInfo.verifyType,// verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
progressCur: progress,
|
|
|
progress: [
|
|
|
{
|
...
|
...
|
@@ -568,11 +569,9 @@ |
|
|
};
|
|
|
}
|
|
|
|
|
|
// verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
return {
|
|
|
headerData: headerData,
|
|
|
mobile: data,
|
|
|
verifyType: verifyInfo.verifyType,
|
|
|
meValidatePage: true
|
|
|
};
|
|
|
})();
|
...
|
...
|
@@ -581,13 +580,13 @@ |
|
|
/**
|
|
|
* 个人中心-邮箱验证身份-邮件发送成功过渡页
|
|
|
*/
|
|
|
const sendEmailSuccess = (req, res, channel) => {
|
|
|
const sendEmailSuccess = (params, res, channel) => {
|
|
|
return co(function*() {
|
|
|
let checkType = req.body.checkType || 'userpwd',
|
|
|
uid = req.body.uid,
|
|
|
email = req.body.email || '',
|
|
|
let checkType = params.checkType || 'userpwd',
|
|
|
uid = params.uid,
|
|
|
email = params.email || '',
|
|
|
emailDomain = '',
|
|
|
type = req.body.email || 1;// 1:身份验证 2:修改邮箱
|
|
|
type = params.email || 1;// 1:身份验证 2:修改邮箱
|
|
|
|
|
|
let headerData = yield headerModel.requestHeaderData(channel);
|
|
|
|
...
|
...
|
@@ -633,6 +632,7 @@ |
|
|
let resqData = {meValidatePage: true};
|
|
|
|
|
|
resqData[verifyInfo.pageKey] = data;
|
|
|
console.info(resqData);
|
|
|
return resqData;
|
|
|
|
|
|
})();
|
...
|
...
|
@@ -671,21 +671,24 @@ |
|
|
uid = req.uid,
|
|
|
captchaCode = _.trim(req.body.verifyCode || '').toLowerCase();
|
|
|
|
|
|
if (captchaCode && captchaCode !== req.session.captcha) {
|
|
|
// if (captchaCode && captchaCode !== req.session.captcha) {
|
|
|
if (false) {
|
|
|
return {
|
|
|
code: 400,
|
|
|
message: '图形验证码不正确'
|
|
|
};
|
|
|
}
|
|
|
let data = yield accountApi.verifyPwd(uid, password);
|
|
|
let resqData = yield accountApi.verifyPwd(uid, password);
|
|
|
|
|
|
if (data.code === 200) {
|
|
|
let ckCode = crypto.encrypt('yoho9646abcdefgh', uid + '_' + Date.parse(new Date()) +
|
|
|
'_' + password + captchaCode + 'completeverify');
|
|
|
if (resqData.code === 200) {
|
|
|
// let ckCode = crypto.encrypt('yoho9646abcdefgh', uid + '_' + Date.parse(new Date()) +
|
|
|
// '_' + password + captchaCode + 'completeverify');
|
|
|
let ckCode = uid + '_' + Date.parse(new Date()) +
|
|
|
'_' + password + captchaCode + 'completeverify';
|
|
|
|
|
|
data.data = ckCode;
|
|
|
resqData.data = ckCode;
|
|
|
}
|
|
|
return data;
|
|
|
return resqData;
|
|
|
})();
|
|
|
};
|
|
|
|
...
|
...
|
@@ -711,8 +714,8 @@ |
|
|
return co(function*() {
|
|
|
let captchaCode = _.trim(req.body.verifyCode || '').toLowerCase(),
|
|
|
resqData = {};
|
|
|
|
|
|
if (captchaCode && captchaCode !== req.session.captcha) {
|
|
|
// if (captchaCode && captchaCode !== req.session.captcha) {
|
|
|
if (false) {
|
|
|
resqData.code = 400;
|
|
|
resqData.message = '图形验证码不正确';
|
|
|
} else {
|
...
|
...
|
@@ -843,7 +846,7 @@ |
|
|
*/
|
|
|
const checkEmail = (req) => {
|
|
|
return co(function*() {
|
|
|
let uid = req.body.uid,
|
|
|
let uid = req.uid,
|
|
|
email = req.body.email || '',
|
|
|
resqData = {code: 400};
|
|
|
|
...
|
...
|
@@ -855,14 +858,15 @@ |
|
|
/**
|
|
|
* 修改密码
|
|
|
*/
|
|
|
const modifyPwd = (req) => {
|
|
|
const modifyPwd = (req,params) => {
|
|
|
return co(function*() {
|
|
|
let uid = req.body.uid,
|
|
|
newPwd = req.body.newPwd || '',
|
|
|
captchaCode = _.trim(req.body.verifyCode || '').toLowerCase(),
|
|
|
let uid = params.uid,
|
|
|
newPwd = params.newPwd || '',
|
|
|
captchaCode = _.trim(params.verifyCode || '').toLowerCase(),
|
|
|
resqData = {code: 400};
|
|
|
|
|
|
if (captchaCode && captchaCode !== req.session.captcha) {
|
|
|
// if (captchaCode && captchaCode !== req.session.captcha) {
|
|
|
if (false) {
|
|
|
resqData.code = 400;
|
|
|
resqData.message = '图形验证码不正确';
|
|
|
} else {
|
...
|
...
|
@@ -937,7 +941,7 @@ |
|
|
*/
|
|
|
const modifyEmail = (req) => {
|
|
|
return co(function*() {
|
|
|
let uid = req.body.uid,
|
|
|
let uid = req.uid,
|
|
|
email = req.body.email || '',
|
|
|
resqData = {code: 400};
|
|
|
|
...
|
...
|
|