Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
shijian
8 years ago
Commit
20d14d689ba868cdf2aa6097ab9013ff137692cd
1 parent
395d4574
save
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
apps/passport/controllers/back.js
apps/passport/controllers/reg.js
public/js/passport/reg/reg.js
apps/passport/controllers/back.js
View file @
20d14d6
...
...
@@ -121,8 +121,21 @@ const sendBackMobileAPI = (req, res, next) => {
let
mobile
=
req
.
body
.
mobile
||
''
;
let
area
=
req
.
body
.
area
||
'86'
;
// 检查上次的发送短信号码
if
(
req
.
session
.
sendMobile
&&
req
.
session
.
sendMobile
!==
mobile
)
{
req
.
session
.
sendMobile
=
''
;
req
.
session
.
captcha
=
''
;
return
res
.
json
({
code
:
400
,
message
:
'验证码失效'
,
data
:
''
});
}
BackService
.
sendCodeToMobileAsync
(
area
,
mobile
)
.
then
(
result
=>
{
// 记录发送短信的号码
req
.
session
.
sendMobile
=
mobile
;
res
.
json
(
result
);
})
.
catch
(
next
);
...
...
apps/passport/controllers/reg.js
View file @
20d14d6
...
...
@@ -10,7 +10,6 @@ const UserService = require('../models/user-service');
const
LoginService
=
require
(
'../models/login-service'
);
const
config
=
require
(
'../../../config/common'
);
const
safeRedirect
=
require
(
'../../../doraemon/middleware/safe-redirect'
).
safeRedirect
;
const
captcha
=
require
(
'./captcha'
);
let
helpers
=
global
.
yoho
.
helpers
;
let
cache
=
global
.
yoho
.
cache
;
...
...
@@ -158,9 +157,10 @@ let sendBindMsg = (req, res, next) => {
// let checkNum = yield cache.get(`regCheckMobileNum_${mobile}`);
// 检查上次的发送短信号码
if
(
captcha
.
checkSendMobile
(
req
,
res
,
true
)
)
{
if
(
req
.
session
.
sendMobile
&&
req
.
session
.
sendMobile
!==
mobile
)
{
req
.
session
.
sendMobile
=
''
;
data
.
message
=
'发送失败'
;
req
.
session
.
captcha
=
''
;
data
.
message
=
'验证码失效'
;
return
res
.
json
(
data
);
}
...
...
public/js/passport/reg/reg.js
View file @
20d14d6
...
...
@@ -575,11 +575,11 @@ exports.init = function() {
}
$smsCaptchaCtrl
.
addClass
(
'disable'
);
disableSMSBtn
();
sendSMSCaptcha
().
then
((
data
)
=>
{
if
(
data
.
code
!==
200
)
{
errTip
(
$
sms
CaptchaInput
,
data
.
message
);
errTip
(
$
img
CaptchaInput
,
data
.
message
);
refreshImgCaptcha
();
}
else
{
hideTip
(
$smsCaptchaInput
);
...
...
Please
register
or
login
to post a comment