...
|
...
|
@@ -75,6 +75,8 @@ const _getTitle = (type)=> { |
|
|
const index = (req, res, next) => {
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
// let uid = req.user.uid || "20000190";
|
|
|
|
|
|
settingModel.getUserInfo(uid).then(result=> {
|
|
|
result.info.gender ? result.genders[result.info.gender - 1].checked = true :
|
|
|
result.genders[2].checked = true;
|
...
|
...
|
@@ -82,7 +84,6 @@ const index = (req, res, next) => { |
|
|
result.info.mobile = result.info.mobile ?
|
|
|
result.info.mobile.substring(0, 3) + '****' + result.info.mobile.substring(7, 11) : '';
|
|
|
result.stepUrl = '/me/setting/step1';
|
|
|
console.log('详情info:', result.info);
|
|
|
res.display('index', {
|
|
|
module: 'me',
|
|
|
page: 'setting',
|
...
|
...
|
@@ -106,10 +107,11 @@ const index = (req, res, next) => { |
|
|
*/
|
|
|
const editUserInfo = (req, res)=> {
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
// let uid = req.user.uid || "20000190";
|
|
|
let query = req.body;
|
|
|
|
|
|
settingModel.editUserInfo(uid, query).then(result=> {
|
|
|
// console.log('修改result', result);
|
|
|
res.send(result);
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -120,13 +122,19 @@ const editUserInfo = (req, res)=> { |
|
|
* */
|
|
|
const bindMobile = (req, res, next) => {
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
// let uid = req.user.uid || "20000190";
|
|
|
let type = req.params.type;
|
|
|
|
|
|
settingModel.getUserInfo(uid).then(result=> {
|
|
|
if (result.info.verify_mobile !== '') {
|
|
|
let info = result.info;
|
|
|
|
|
|
info.ellipsisMobile = info.mobile.substring(0, 3) + '****' + info.mobile.substring(7, 11);
|
|
|
info.ellipsisMobile = info.verify_mobile.substring(0, 3) + '****' + info.verify_mobile.substring(7, 11);
|
|
|
info.checkCode = settingModel.cipheriv(info.uid + '.completeverify');
|
|
|
|
|
|
// info.checkCode = settingModel.cipheriv("20000190" + ".completeverify");
|
|
|
console.log('info.checkCode:', info.checkCode);
|
|
|
res.display('index', {
|
|
|
module: 'me',
|
|
|
page: 'setting',
|
...
|
...
|
@@ -137,7 +145,7 @@ const bindMobile = (req, res, next) => { |
|
|
nav: mcHandler.getMeCrumb('个人设置'),
|
|
|
navigation: mcHandler.getSideMenu('个人设置'),
|
|
|
banner: 'http://placehold.it/150x120',
|
|
|
step1: true,
|
|
|
validateStep: true,
|
|
|
title: _getTitle(type).typeName,
|
|
|
proTitle: _getTitle(type).proName,
|
|
|
captchaUrl: captchaUrl,
|
...
|
...
|
@@ -152,13 +160,18 @@ const bindMobile = (req, res, next) => { |
|
|
|
|
|
const bindEmail = (req, res, next) => {
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
// let uid = req.user.uid || "20000190";
|
|
|
let type = req.params.type;
|
|
|
|
|
|
settingModel.getUserInfo(uid).then(result=> {
|
|
|
if (result.info.verify_email !== '') {
|
|
|
let info = result.info;
|
|
|
|
|
|
info.ellipsisEmail = info.email.substring(0, 3) + '****' + info.email.substring(7, 11);
|
|
|
info.ellipsisEmail = info.verify_email.substring(0, 3) + '****' + info.verify_email.substring(7, 11);
|
|
|
info.checkCode = settingModel.cipheriv(info.uid + '.completeverify');
|
|
|
|
|
|
// info.checkCode = settingModel.cipheriv("20000190" + ".completeverify");
|
|
|
res.display('index', {
|
|
|
module: 'me',
|
|
|
page: 'setting',
|
...
|
...
|
@@ -167,7 +180,7 @@ const bindEmail = (req, res, next) => { |
|
|
nav: mcHandler.getMeCrumb('个人设置'),
|
|
|
navigation: mcHandler.getSideMenu('个人设置'),
|
|
|
banner: 'http://placehold.it/150x120',
|
|
|
step1: true,
|
|
|
validateStep: true,
|
|
|
title: _getTitle(type).typeName,
|
|
|
proTitle: _getTitle(type).proName,
|
|
|
captchaUrl: captchaUrl,
|
...
|
...
|
@@ -183,6 +196,9 @@ const bindEmail = (req, res, next) => { |
|
|
const modifyPassword = (req, res) => {
|
|
|
let type = req.params.type;
|
|
|
|
|
|
let checkCode = settingModel.cipheriv(req.user.uid + '.completeverify');
|
|
|
|
|
|
// let checkCode = settingModel.cipheriv("20000190" + ".completeverify");
|
|
|
res.display('index', {
|
|
|
module: 'me',
|
|
|
page: 'setting',
|
...
|
...
|
@@ -191,11 +207,12 @@ const modifyPassword = (req, res) => { |
|
|
nav: mcHandler.getMeCrumb('个人设置'),
|
|
|
navigation: mcHandler.getSideMenu('个人设置'),
|
|
|
banner: 'http://placehold.it/150x120',
|
|
|
step1: true,
|
|
|
validateStep: true,
|
|
|
title: _getTitle(type).typeName,
|
|
|
proTitle: _getTitle(type).proName,
|
|
|
captchaUrl: captchaUrl,
|
|
|
isShowPassword: true
|
|
|
isShowPassword: true,
|
|
|
checkCode: checkCode
|
|
|
}
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -205,7 +222,11 @@ const modifyPassword = (req, res) => { |
|
|
* */
|
|
|
const edit = (req, res)=> {
|
|
|
let type = req.params.type;
|
|
|
let code = settingModel.decipheriv(req.query.checkCode.split(' ').join('+'));
|
|
|
let codes = code.split('.');
|
|
|
|
|
|
if (codes[0] === req.user.uid && codes[1] === 'completeverify') {
|
|
|
// if (codes[0] === "20000190" && codes[1] === "completeverify") {
|
|
|
let result = {
|
|
|
title: _getTitle(type).typeName,
|
|
|
proTitle: _getTitle(type).proName,
|
...
|
...
|
@@ -214,6 +235,9 @@ const edit = (req, res)=> { |
|
|
isShowPassword: _getTitle(type).isShowPassword
|
|
|
};
|
|
|
|
|
|
let checkCode = settingModel.cipheriv(req.user.uid + '.completeoperate');
|
|
|
|
|
|
// let checkCode = settingModel.cipheriv("20000190"+ ".completeoperate");
|
|
|
res.display('index', {
|
|
|
module: 'me',
|
|
|
page: 'setting',
|
...
|
...
|
@@ -224,11 +248,15 @@ const edit = (req, res)=> { |
|
|
nav: mcHandler.getMeCrumb('个人设置'),
|
|
|
navigation: mcHandler.getSideMenu('个人设置'),
|
|
|
banner: 'http://placehold.it/150x120',
|
|
|
step2: true,
|
|
|
operateStep: true,
|
|
|
stepUrl: '/me/setting/step3/' + type,
|
|
|
captchaUrl: captchaUrl
|
|
|
captchaUrl: captchaUrl,
|
|
|
checkCode: checkCode
|
|
|
}, result)
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
/*
|
...
|
...
|
@@ -236,7 +264,11 @@ const edit = (req, res)=> { |
|
|
* */
|
|
|
const success = (req, res)=> {
|
|
|
let type = req.params.type;
|
|
|
let code = settingModel.decipheriv(req.query.checkCode.split(' ').join('+'));
|
|
|
let codes = code.split('.');
|
|
|
|
|
|
if (codes[0] === req.user.uid && codes[1] === 'completeoperate') {
|
|
|
// if (codes[0] === "20000190" && codes[1] === "completeoperate") {
|
|
|
let result = {
|
|
|
title: _getTitle(type).typeName,
|
|
|
proTitle: _getTitle(type).proName,
|
...
|
...
|
@@ -257,10 +289,12 @@ const success = (req, res)=> { |
|
|
nav: mcHandler.getMeCrumb('个人设置'),
|
|
|
navigation: mcHandler.getSideMenu('个人设置'),
|
|
|
banner: 'http://placehold.it/150x120',
|
|
|
step3: true,
|
|
|
successStep: true,
|
|
|
captchaUrl: captchaUrl
|
|
|
}, result)
|
|
|
});
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
/*
|
...
|
...
|
@@ -269,6 +303,8 @@ const success = (req, res)=> { |
|
|
const validate1 = (req, res)=> {
|
|
|
co(function *() {
|
|
|
let type = req.params.type;
|
|
|
|
|
|
// let uid = req.user.uid || "20000190";
|
|
|
let uid = req.user.uid;
|
|
|
let body = req.body;
|
|
|
|
...
|
...
|
@@ -295,6 +331,8 @@ const validate2 = (req, res)=> { |
|
|
co(function *() {
|
|
|
let type = req.params.type;
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
// let uid = req.user.uid || "20000190";
|
|
|
let body = req.body;
|
|
|
|
|
|
if (type === 'password') {
|
...
|
...
|
|