Authored by 郭成尧

reset-api-method

... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-04-13 10:21:07
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-13 14:01:50
* @Last Modified time: 2017-04-14 13:49:39
*/
/* ********************
... ... @@ -30,8 +30,21 @@ const passwordResetPage = (req, res) => {
* @param {*} next
*/
const passwordReset = (req, res, next) => {
reset.resetPassword({
let uid = req.user.uid;
let token = req.body.token;
if (!uid || !token) {
return res.json({
code: 400,
massage: '非法请求!'
});
}
reset.resetPassword({
uid: req.user.uid,
oldPwd: req.body.oldPwd,
newPwd: req.body.newPwd,
token: token
}).then(result => {
res.json(result);
}).catch(next);
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-04-13 10:25:56
* @Last Modified by: Targaryen
* @Last Modified time: 2017-04-13 10:29:26
* @Last Modified time: 2017-04-14 13:48:19
*/
/* ******************
... ... @@ -19,10 +19,11 @@ const api = global.yoho.API;
*/
const resetPassword = (params) => {
return api.post('', {
method: '',
oldPassword: params.oldPassword,
newPassword: params.newPassword,
username: params.username
method: 'app.password.modPwdByCode',
uid: params.uid,
oldPwd: params.oldPwd,
newPwd: params.newPwd,
token: params.token
});
};
... ...
... ... @@ -13,8 +13,8 @@ const domains = {
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/',
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/',
... ...