Showing
1 changed file
with
7 additions
and
7 deletions
@@ -87,7 +87,7 @@ const cookieHelper = { | @@ -87,7 +87,7 @@ const cookieHelper = { | ||
87 | getVal(req, k) { | 87 | getVal(req, k) { |
88 | return req.cookies[k]; | 88 | return req.cookies[k]; |
89 | } | 89 | } |
90 | -} | 90 | +}; |
91 | 91 | ||
92 | /** | 92 | /** |
93 | * 个人设置页面加载 | 93 | * 个人设置页面加载 |
@@ -265,7 +265,7 @@ const modifyType = (req, res) => { | @@ -265,7 +265,7 @@ const modifyType = (req, res) => { | ||
265 | const edit = (req, res) => { | 265 | const edit = (req, res) => { |
266 | let type = req.params.type; | 266 | let type = req.params.type; |
267 | 267 | ||
268 | - if (Number(cookieHelper.getVal(req, type + "_STEP")) !== 1) { | 268 | + if (Number(cookieHelper.getVal(req, type + '_STEP')) !== 1) { |
269 | res.redirect(helpers.urlFormat('/me/setting/step1/' + type)); | 269 | res.redirect(helpers.urlFormat('/me/setting/step1/' + type)); |
270 | return; | 270 | return; |
271 | } | 271 | } |
@@ -304,14 +304,14 @@ const edit = (req, res) => { | @@ -304,14 +304,14 @@ const edit = (req, res) => { | ||
304 | const success = (req, res) => { | 304 | const success = (req, res) => { |
305 | let type = req.params.type; | 305 | let type = req.params.type; |
306 | 306 | ||
307 | - let step = Number(cookieHelper.getVal(req, type + "_STEP")) || 0; | 307 | + let step = Number(cookieHelper.getVal(req, type + '_STEP')) || 0; |
308 | 308 | ||
309 | if (step !== 2) { | 309 | if (step !== 2) { |
310 | res.redirect(helpers.urlFormat('/me/setting/step' + (step + 1) + '/' + type)); | 310 | res.redirect(helpers.urlFormat('/me/setting/step' + (step + 1) + '/' + type)); |
311 | return; | 311 | return; |
312 | } | 312 | } |
313 | 313 | ||
314 | - cookieHelper.setVal(res, type + "_STEP", 0, { | 314 | + cookieHelper.setVal(res, type + '_STEP', 0, { |
315 | maxAge: -1 | 315 | maxAge: -1 |
316 | }); | 316 | }); |
317 | 317 | ||
@@ -363,7 +363,7 @@ const validate1 = (req, res) => { | @@ -363,7 +363,7 @@ const validate1 = (req, res) => { | ||
363 | } | 363 | } |
364 | 364 | ||
365 | if (a) { | 365 | if (a) { |
366 | - cookieHelper.setVal(res, req.body.type + "_STEP", 1); | 366 | + cookieHelper.setVal(res, req.body.type + '_STEP', 1); |
367 | res.send(a); | 367 | res.send(a); |
368 | } | 368 | } |
369 | })(); | 369 | })(); |
@@ -382,7 +382,7 @@ const validate2 = (req, res) => { | @@ -382,7 +382,7 @@ const validate2 = (req, res) => { | ||
382 | let a = yield accountModel.changePwd(uid, body.password); | 382 | let a = yield accountModel.changePwd(uid, body.password); |
383 | 383 | ||
384 | if (a.code === 200) { | 384 | if (a.code === 200) { |
385 | - cookieHelper.setVal(res, body.type + "_STEP", 2); | 385 | + cookieHelper.setVal(res, body.type + '_STEP', 2); |
386 | res.send(a); | 386 | res.send(a); |
387 | } | 387 | } |
388 | 388 | ||
@@ -391,7 +391,7 @@ const validate2 = (req, res) => { | @@ -391,7 +391,7 @@ const validate2 = (req, res) => { | ||
391 | let b = yield accountModel.modifyVerifyMobile(uid, body.area, body.mobile); | 391 | let b = yield accountModel.modifyVerifyMobile(uid, body.area, body.mobile); |
392 | 392 | ||
393 | if (a.code === 200 && b.code === 200) { | 393 | if (a.code === 200 && b.code === 200) { |
394 | - cookieHelper.setVal(res, body.type + "_STEP", 2); | 394 | + cookieHelper.setVal(res, body.type + '_STEP', 2); |
395 | res.send({ | 395 | res.send({ |
396 | code: 200, | 396 | code: 200, |
397 | data: {} | 397 | data: {} |
-
Please register or login to post a comment