Showing
1 changed file
with
9 additions
and
0 deletions
@@ -184,6 +184,8 @@ let sendBindMsg = (req, res, next) => { | @@ -184,6 +184,8 @@ let sendBindMsg = (req, res, next) => { | ||
184 | /* 向手机发送注册验证码 */ | 184 | /* 向手机发送注册验证码 */ |
185 | let result = yield regService.sendCodeToMobile(area, mobile); | 185 | let result = yield regService.sendCodeToMobile(area, mobile); |
186 | 186 | ||
187 | + req.session.type = 'register-step1'; | ||
188 | + | ||
187 | return cache.set(sendCodeKey, sendCodeTimes + 1, 3600).then(() => { | 189 | return cache.set(sendCodeKey, sendCodeTimes + 1, 3600).then(() => { |
188 | if (result.code) { | 190 | if (result.code) { |
189 | return res.json(result); | 191 | return res.json(result); |
@@ -229,6 +231,10 @@ let mobileRegister = (req, res, next) => { | @@ -229,6 +231,10 @@ let mobileRegister = (req, res, next) => { | ||
229 | data: '' | 231 | data: '' |
230 | }; | 232 | }; |
231 | 233 | ||
234 | + if (req.session.type !== 'register-step1') { | ||
235 | + return res.json(data); | ||
236 | + } | ||
237 | + | ||
232 | /* 判断是否是有效的注册方式,防注册机刷 */ | 238 | /* 判断是否是有效的注册方式,防注册机刷 */ |
233 | let regExpireTime = req.session.REG_EXPIRE_; | 239 | let regExpireTime = req.session.REG_EXPIRE_; |
234 | 240 | ||
@@ -273,6 +279,9 @@ let mobileRegister = (req, res, next) => { | @@ -273,6 +279,9 @@ let mobileRegister = (req, res, next) => { | ||
273 | return res.json(data); | 279 | return res.json(data); |
274 | } | 280 | } |
275 | 281 | ||
282 | + // 清除 session type | ||
283 | + req.session.type = ''; | ||
284 | + | ||
276 | let uid = { | 285 | let uid = { |
277 | toString() { | 286 | toString() { |
278 | return this.uid; | 287 | return this.uid; |
-
Please register or login to post a comment