Merge branch 'feature/safe-bug' of http://git.yoho.cn/fe/yoho-blk into feature/safe-bug
Showing
2 changed files
with
12 additions
and
3 deletions
@@ -382,10 +382,18 @@ const validate2 = (req, res, next) => { | @@ -382,10 +382,18 @@ const validate2 = (req, res, next) => { | ||
382 | let uid = req.user.uid; | 382 | let uid = req.user.uid; |
383 | let body = req.body; | 383 | let body = req.body; |
384 | 384 | ||
385 | + if (!req.session.safeAccount) { | ||
386 | + return res.send({ | ||
387 | + code: 400, | ||
388 | + message: '修改失败,请重新验证身份' | ||
389 | + }); | ||
390 | + } | ||
391 | + | ||
385 | if (type === 'password') { | 392 | if (type === 'password') { |
386 | let a = yield accountModel.changePwd(uid, body.password); | 393 | let a = yield accountModel.changePwd(uid, body.password); |
387 | 394 | ||
388 | if (a.code === 200) { | 395 | if (a.code === 200) { |
396 | + req.session.safeAccount = false; | ||
389 | cookieHelper.setVal(res, body.type + '_STEP', 2); | 397 | cookieHelper.setVal(res, body.type + '_STEP', 2); |
390 | res.send(a); | 398 | res.send(a); |
391 | } | 399 | } |
@@ -401,6 +409,7 @@ const validate2 = (req, res, next) => { | @@ -401,6 +409,7 @@ const validate2 = (req, res, next) => { | ||
401 | 409 | ||
402 | cookieHelper.setVal(res, body.type + '_STEP', 2); | 410 | cookieHelper.setVal(res, body.type + '_STEP', 2); |
403 | if (c.code === 200) { | 411 | if (c.code === 200) { |
412 | + req.session.safeAccount = false; | ||
404 | res.send({ | 413 | res.send({ |
405 | code: 200, | 414 | code: 200, |
406 | data: {} | 415 | data: {} |
@@ -218,9 +218,6 @@ const bindCheck = (req, res, next) => { | @@ -218,9 +218,6 @@ const bindCheck = (req, res, next) => { | ||
218 | } else if (result.code === 200 && result.data.is_register === 1) { | 218 | } else if (result.code === 200 && result.data.is_register === 1) { |
219 | return UserService.getUserInfoAsync(area, mobile).then(user => { | 219 | return UserService.getUserInfoAsync(area, mobile).then(user => { |
220 | // 绑定流程:code=201 已注册 绑定过其他第三方 | 220 | // 绑定流程:code=201 已注册 绑定过其他第三方 |
221 | - req.session.thirdBind = { | ||
222 | - mobile: mobile | ||
223 | - }; | ||
224 | return { code: 201, message: result.message, data: { user: user } }; | 221 | return { code: 201, message: result.message, data: { user: user } }; |
225 | }); | 222 | }); |
226 | } else if (result.code === 200 && result.data.is_register === 3) { | 223 | } else if (result.code === 200 && result.data.is_register === 3) { |
@@ -253,6 +250,9 @@ const sendBindMsg = (req, res, next) => { | @@ -253,6 +250,9 @@ const sendBindMsg = (req, res, next) => { | ||
253 | 250 | ||
254 | BindService.sendBindMsgAsync(area, mobile).then(result => { | 251 | BindService.sendBindMsgAsync(area, mobile).then(result => { |
255 | if (result && result.code) { | 252 | if (result && result.code) { |
253 | + req.session.thirdBind = { | ||
254 | + mobile: mobile | ||
255 | + }; | ||
256 | res.json(result); | 256 | res.json(result); |
257 | } else { | 257 | } else { |
258 | res.json({ code: 400, message: '', data: '' }); | 258 | res.json({ code: 400, message: '', data: '' }); |
-
Please register or login to post a comment