Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
7 years ago
Commit
f6ddda2d75b5d04191613fc1185dab459992a224
1 parent
cedf1c91
'绑定手机号成功界面'
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
60 deletions
apps/passport/controllers/bind.js
apps/passport/router.js
public/js/passport/bind/email-mobile.js
apps/passport/controllers/bind.js
View file @
f6ddda2
...
...
@@ -372,16 +372,13 @@ const bind = {
// 调用绑定接口
forceBindMobileApi
:
(
req
,
res
,
next
)
=>
{
if
(
req
.
session
.
bindEmail
&&
req
.
session
.
bindPass
)
{
return
res
.
json
({
code
:
301
,
data
:
{},
message
:
'success'
});
if
(
!
req
.
session
.
bindEmail
||
!
req
.
session
.
bindPassword
)
{
return
res
.
json
({
code
:
401
,
data
:
{},
message
:
'请重新登录授权'
});
}
req
.
body
.
email
=
'1181060696@qq.com'
;
req
.
body
.
password
=
'hao123456'
;
req
.
ctx
(
BindServiceModel
).
bindEmailLoginMobile
(
Object
.
assign
(
req
.
body
,
{
email
:
req
.
session
.
bindEmail
,
password
:
req
.
session
.
bindPass
,
password
:
req
.
session
.
bindPass
word
,
})).
then
(
result
=>
{
if
(
_
.
get
(
result
,
'code'
,
400
)
!==
200
)
{
return
res
.
json
(
result
);
...
...
@@ -394,7 +391,7 @@ const bind = {
result
.
data
.
session_key
).
then
(()
=>
{
delete
req
.
session
.
bindEmail
;
delete
req
.
session
.
bindPass
;
delete
req
.
session
.
bindPass
word
;
return
res
.
json
({
code
:
200
,
data
:
{},
message
:
'success'
});
});
}).
catch
(
next
);
...
...
apps/passport/router.js
View file @
f6ddda2
...
...
@@ -83,9 +83,8 @@ router.get('/passport/password/resetsuccess', reset.passwordResetOkPage); // 重
// 通过邮箱登录绑定手机号
router
.
get
(
'/passport/bind/forceBindMobile'
,
validateCode
.
load
,
bind
.
forceBindMobilePage
);
router
.
post
(
'/passport/bind/forceSendMsg'
,
bind
.
sendMsgApi
,
bind
.
forceSendMsg
);
router
.
post
(
'/passport/bind/forceSendMsg'
,
validateCode
.
check
,
bind
.
sendMsgApi
,
bind
.
forceSendMsg
);
router
.
post
(
'/passport/bind/forceMobileCheck'
,
validateCode
.
check
,
bind
.
forceMobileCheckApi
,
bind
.
forceBindMobileApi
);
...
...
public/js/passport/bind/email-mobile.js
View file @
f6ddda2
...
...
@@ -147,26 +147,34 @@ class EmailMobile extends Page {
this
.
selector
.
verifyCodeBtn
.
data
(
'oneClick'
,
true
);
let
params
=
{
area
:
area
.
replace
(
'+'
,
''
),
mobile
:
pn
};
validate
.
getResults
().
then
(
result
=>
{
let
params
=
{
area
:
area
.
replace
(
'+'
,
''
),
mobile
:
pn
};
this
.
ajax
({
url
:
'/passport/bind/forceSendMsg'
,
type
:
'POST'
,
data
:
params
}).
then
(
codeResult
=>
{
this
.
selector
.
verifyCodeBtn
.
data
(
'oneClick'
,
false
);
if
(
codeResult
.
code
===
200
)
{
this
.
countDown
();
return
;
}
else
{
showErrTip
(
codeResult
.
message
);
}
}).
catch
(()
=>
{
this
.
selector
.
verifyCodeBtn
.
data
(
'oneClick'
,
false
);
showErrTip
(
'出错了,请重试'
);
$
.
extend
(
params
,
result
);
this
.
ajax
({
url
:
'/passport/bind/forceSendMsg'
,
type
:
'POST'
,
data
:
params
}).
then
(
codeResult
=>
{
this
.
selector
.
verifyCodeBtn
.
data
(
'oneClick'
,
false
);
validate
.
type
===
2
&&
validate
.
refresh
();
if
(
codeResult
.
code
===
200
)
{
this
.
countDown
();
return
;
}
else
{
showErrTip
(
codeResult
.
message
);
}
(
codeResult
.
changeCaptcha
&&
validate
.
type
!==
2
)
&&
validate
.
refresh
();
}).
catch
(()
=>
{
this
.
selector
.
verifyCodeBtn
.
data
(
'oneClick'
,
false
);
showErrTip
(
'出错了,请重试'
);
validate
.
refresh
();
});
});
}
...
...
@@ -187,39 +195,30 @@ class EmailMobile extends Page {
this
.
selector
.
loginBtn
.
data
(
'oneClick'
,
true
);
validate
.
getResults
().
then
(
result
=>
{
let
params
=
{
area
:
area
.
replace
(
'+'
,
''
),
mobile
:
pn
,
code
:
verifyCode
,
};
$
.
extend
(
params
,
result
);
this
.
ajax
({
url
:
'/passport/bind/forceMobileCheck'
,
type
:
'POST'
,
data
:
params
}).
then
(
codeResult
=>
{
this
.
selector
.
loginBtn
.
data
(
'oneClick'
,
false
);
validate
.
type
===
2
&&
validate
.
refresh
();
let
params
=
{
area
:
area
.
replace
(
'+'
,
''
),
mobile
:
pn
,
code
:
verifyCode
,
};
if
(
codeResult
.
code
===
200
)
{
this
.
continueBind
(
$
.
extend
({
isBind
:
'N'
,
isRegister
:
'N'
},
codeResult
.
data
),
params
);
}
else
{
showErrTip
(
codeResult
.
message
);
}
this
.
ajax
({
url
:
'/passport/bind/forceMobileCheck'
,
type
:
'POST'
,
data
:
params
}).
then
(
codeResult
=>
{
this
.
selector
.
loginBtn
.
data
(
'oneClick'
,
false
);
(
codeResult
.
changeCaptcha
&&
validate
.
type
!==
2
)
&&
validate
.
refresh
();
}).
catch
(()
=>
{
this
.
selector
.
loginBtn
.
data
(
'oneClick'
,
false
);
showErrTip
(
'出错了,请重试'
);
validate
.
refresh
();
});
if
(
codeResult
.
code
===
200
)
{
this
.
continueBind
(
$
.
extend
({
isBind
:
'N'
,
isRegister
:
'N'
},
codeResult
.
data
),
params
);
}
else
{
showErrTip
(
codeResult
.
message
);
}
}).
catch
(()
=>
{
this
.
selector
.
loginBtn
.
data
(
'oneClick'
,
false
);
showErrTip
(
'出错了,请重试'
);
});
}
...
...
@@ -238,7 +237,7 @@ class EmailMobile extends Page {
}
dialog
.
showDialog
({
dialogText
:
bindDialogHbs
(
{
isBind
:
true
}
),
dialogText
:
bindDialogHbs
(
bindParams
),
fast
:
true
,
hasFooter
:
{
leftBtnText
:
'去登录'
,
...
...
Please
register
or
login
to post a comment