...
|
...
|
@@ -166,7 +166,7 @@ const bindMobile = (req, res, next) => { |
|
|
|
|
|
settingModel.getUserInfo(uid).then(result => {
|
|
|
if (result.info.verify_mobile !== '') {
|
|
|
mcHandler.getMeThumb().then((thumb) => {
|
|
|
return mcHandler.getMeThumb().then((thumb) => {
|
|
|
let info = result.info;
|
|
|
|
|
|
info.ellipsisMobile = info.verify_mobile.replace(regMobile, '$1****$2');
|
...
|
...
|
@@ -193,7 +193,7 @@ const bindMobile = (req, res, next) => { |
|
|
});
|
|
|
}
|
|
|
next();
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -210,7 +210,7 @@ const bindEmail = (req, res, next) => { |
|
|
info.ellipsisEmail = info.verify_email.replace(regEmail, '$1****');
|
|
|
info.checkCode = req.csrfToken();
|
|
|
|
|
|
mcHandler.getMeThumb().then((thumb) => {
|
|
|
return mcHandler.getMeThumb().then((thumb) => {
|
|
|
res.display('index', {
|
|
|
module: 'me',
|
|
|
page: 'setting',
|
...
|
...
|
@@ -230,13 +230,13 @@ const bindEmail = (req, res, next) => { |
|
|
});
|
|
|
}
|
|
|
next();
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
*step1 登录密码进行身份验证
|
|
|
*/
|
|
|
const modifyType = (req, res) => {
|
|
|
const modifyType = (req, res, next) => {
|
|
|
let type = req.params.type;
|
|
|
|
|
|
mcHandler.getMeThumb().then((thumb) => {
|
...
|
...
|
@@ -256,13 +256,13 @@ const modifyType = (req, res) => { |
|
|
checkCode: req.csrfToken()
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
/*
|
|
|
* step2 操作界面-渲染页面
|
|
|
* */
|
|
|
const edit = (req, res) => {
|
|
|
const edit = (req, res, next) => {
|
|
|
let type = req.params.type;
|
|
|
|
|
|
if (Number(cookieHelper.getVal(req, type + '_STEP')) !== 1) {
|
...
|
...
|
@@ -295,13 +295,13 @@ const edit = (req, res) => { |
|
|
checkCode: req.csrfToken()
|
|
|
}, result)
|
|
|
});
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
/*
|
|
|
* step3 操作成功-渲染界面
|
|
|
* */
|
|
|
const success = (req, res) => {
|
|
|
const success = (req, res, next) => {
|
|
|
let type = req.params.type;
|
|
|
|
|
|
let step = Number(cookieHelper.getVal(req, type + '_STEP')) || 0;
|
...
|
...
|
@@ -340,14 +340,14 @@ const success = (req, res) => { |
|
|
captchaUrl: captchaUrl
|
|
|
}, result)
|
|
|
});
|
|
|
});
|
|
|
}).catch(next);
|
|
|
|
|
|
};
|
|
|
|
|
|
/*
|
|
|
* post1 第一步身份验证的post请求
|
|
|
* */
|
|
|
const validate1 = (req, res) => {
|
|
|
const validate1 = (req, res, next) => {
|
|
|
co(function*() {
|
|
|
let type = req.params.type;
|
|
|
let uid = req.user.uid;
|
...
|
...
|
@@ -366,13 +366,13 @@ const validate1 = (req, res) => { |
|
|
cookieHelper.setVal(res, req.body.type + '_STEP', 1);
|
|
|
res.send(a);
|
|
|
}
|
|
|
})();
|
|
|
})().catch(next);
|
|
|
};
|
|
|
|
|
|
/*
|
|
|
* post2 第二步具体操作的post请求
|
|
|
* */
|
|
|
const validate2 = (req, res) => {
|
|
|
const validate2 = (req, res, next) => {
|
|
|
co(function*() {
|
|
|
let type = req.params.type;
|
|
|
let uid = req.user.uid;
|
...
|
...
|
@@ -411,7 +411,7 @@ const validate2 = (req, res) => { |
|
|
});
|
|
|
}
|
|
|
}
|
|
|
})();
|
|
|
})().catch(next);
|
|
|
};
|
|
|
|
|
|
|
...
|
...
|
@@ -438,14 +438,14 @@ function getfilePath(req, res, next) { |
|
|
* @param req
|
|
|
* @param res
|
|
|
*/
|
|
|
const modifyHead = (req, res) => {
|
|
|
const modifyHead = (req, res, next) => {
|
|
|
let uid = req.user.uid;
|
|
|
let bucket = 'yhb-head';
|
|
|
let filePath = req.filePath;
|
|
|
|
|
|
settingModel.modifyHead(uid, bucket, filePath).then(result => {
|
|
|
res.send(result);
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
...
|
...
|
|