...
|
...
|
@@ -207,7 +207,6 @@ |
|
|
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,
|
...
|
...
|
@@ -341,6 +340,7 @@ |
|
|
success = params.success || false,
|
|
|
progress = 'progress' + step,
|
|
|
uid = params.uid;
|
|
|
|
|
|
// 第二步验证信息校验
|
|
|
if (step === 2 && ckCode !== '') {
|
|
|
let checkFlag = checkCode(ckCode, uid);
|
...
|
...
|
@@ -349,6 +349,7 @@ |
|
|
res.redirect(helpers.urlFormat('/home/account/userpwd', {step: 1}));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 验证信息
|
|
|
let verifyInfo = yield auditCheckStatus(uid, 'userpwd', step);
|
|
|
|
...
|
...
|
@@ -362,7 +363,7 @@ |
|
|
let data = {
|
|
|
subTitle: verifyInfo.subTitle,
|
|
|
enTitle: verifyInfo.enTitle,
|
|
|
verifyType: verifyInfo.verifyType,// verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
verifyType: verifyInfo.verifyType, // verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
progressCur: progress,
|
|
|
progress: [
|
|
|
{
|
...
|
...
|
@@ -444,7 +445,7 @@ |
|
|
let data = {
|
|
|
subTitle: verifyInfo.subTitle,
|
|
|
enTitle: verifyInfo.enTitle,
|
|
|
verifyType: verifyInfo.verifyType,// verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
verifyType: verifyInfo.verifyType, // verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
progressCur: progress,
|
|
|
progress: [
|
|
|
{
|
...
|
...
|
@@ -478,9 +479,9 @@ |
|
|
} else if (step === 3) {
|
|
|
data.progress[2].iscur = true;
|
|
|
data.returnInfo = true;
|
|
|
data.resClass = success ? 'res-success' : 'res-error';
|
|
|
data.resClass = success === true ? 'res-success' : 'res-error';
|
|
|
data.complete = {
|
|
|
resInfo: success ? '恭喜您,您已经成功' + verifyInfo.subTitle +
|
|
|
resInfo: success === true ? '恭喜您,您已经成功' + verifyInfo.subTitle +
|
|
|
'!' : '抱歉,' + verifyInfo.subTitle + '失败'
|
|
|
};
|
|
|
}
|
...
|
...
|
@@ -496,15 +497,15 @@ |
|
|
/**
|
|
|
* 个人中心-手机验证身份-page1/2/3
|
|
|
*/
|
|
|
const userMobile = (req, res, channel) => {
|
|
|
const userMobile = (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) {
|
...
|
...
|
@@ -527,7 +528,7 @@ |
|
|
let data = {
|
|
|
subTitle: verifyInfo.subTitle,
|
|
|
enTitle: verifyInfo.enTitle,
|
|
|
verifyType: verifyInfo.verifyType,// verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
verifyType: verifyInfo.verifyType, // verifyType 1:登录密码验证 2:邮箱验证 3:手机验证
|
|
|
progressCur: progress,
|
|
|
progress: [
|
|
|
{
|
...
|
...
|
@@ -600,7 +601,7 @@ |
|
|
};
|
|
|
}
|
|
|
emailDomain = 'http://' + ((email.split[1] === 'gmail.com') ?
|
|
|
'mail.google.com' : 'mail.' + email.split[1]);
|
|
|
'mail.google.com' : 'mail.' + email.split('@')[1]);
|
|
|
let data = {
|
|
|
subTitle: verifyInfo.subTitle,
|
|
|
enTitle: verifyInfo.enTitle,
|
...
|
...
|
@@ -632,7 +633,6 @@ |
|
|
let resqData = {meValidatePage: true};
|
|
|
|
|
|
resqData[verifyInfo.pageKey] = data;
|
|
|
console.info(resqData);
|
|
|
return resqData;
|
|
|
|
|
|
})();
|
...
|
...
|
@@ -641,22 +641,23 @@ |
|
|
/**
|
|
|
* 点击邮箱验证链接方法--修改验证邮箱
|
|
|
*/
|
|
|
const mailResult = (req, res) => {
|
|
|
const mailResult = (params, res) => {
|
|
|
return co(function*() {
|
|
|
let code = req.body.code;
|
|
|
let code = params.code;
|
|
|
|
|
|
let check = yield accountApi.checkEmailCode(code);
|
|
|
|
|
|
|
|
|
if (check.code === 200) {
|
|
|
let data = yield accountApi.modifyVerifyEmail(code);
|
|
|
|
|
|
console.info(data);
|
|
|
if (data.code === 200) {
|
|
|
res.redirect(helpers.urlFormat('/home/account/email',
|
|
|
res.redirect(helpers.urlFormat('localhost:6002/home/account/email',
|
|
|
{step: 3, success: true}));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
res.redirect(helpers.urlFormat('/home/account/email',
|
|
|
res.redirect(helpers.urlFormat('localhost:6002/home/account/email',
|
|
|
{step: 3, success: false}));
|
|
|
|
|
|
})();
|
...
|
...
|
@@ -672,11 +673,12 @@ |
|
|
captchaCode = _.trim(req.body.verifyCode || '').toLowerCase();
|
|
|
|
|
|
// if (captchaCode && captchaCode !== req.session.captcha) {
|
|
|
if (false) {
|
|
|
if (captchaCode === '') {
|
|
|
return {
|
|
|
code: 400,
|
|
|
message: '图形验证码不正确'
|
|
|
};
|
|
|
|
|
|
}
|
|
|
let resqData = yield accountApi.verifyPwd(uid, password);
|
|
|
|
...
|
...
|
@@ -714,8 +716,9 @@ |
|
|
return co(function*() {
|
|
|
let captchaCode = _.trim(req.body.verifyCode || '').toLowerCase(),
|
|
|
resqData = {};
|
|
|
|
|
|
// if (captchaCode && captchaCode !== req.session.captcha) {
|
|
|
if (false) {
|
|
|
if (captchaCode === '') {
|
|
|
resqData.code = 400;
|
|
|
resqData.message = '图形验证码不正确';
|
|
|
} else {
|
...
|
...
|
@@ -858,7 +861,7 @@ |
|
|
/**
|
|
|
* 修改密码
|
|
|
*/
|
|
|
const modifyPwd = (req,params) => {
|
|
|
const modifyPwd = (req, params) => {
|
|
|
return co(function*() {
|
|
|
let uid = params.uid,
|
|
|
newPwd = params.newPwd || '',
|
...
|
...
|
@@ -866,7 +869,7 @@ |
|
|
resqData = {code: 400};
|
|
|
|
|
|
// if (captchaCode && captchaCode !== req.session.captcha) {
|
|
|
if (false) {
|
|
|
if (captchaCode === '') {
|
|
|
resqData.code = 400;
|
|
|
resqData.message = '图形验证码不正确';
|
|
|
} else {
|
...
|
...
|
@@ -922,10 +925,9 @@ |
|
|
/**
|
|
|
* 分-检查手机号是否可修改-ajax
|
|
|
*/
|
|
|
const checkMobile = (req) => {
|
|
|
const checkMobile = (params, uid) => {
|
|
|
return co(function*() {
|
|
|
let uid = req.body.uid,
|
|
|
mobile = req.body.mobile || '',
|
|
|
let mobile = params.mobile || '',
|
|
|
resqData = {code: 400};
|
|
|
|
|
|
let mobileInfo = handleMobile(mobile);
|
...
|
...
|
|