Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
7 years ago
Commit
e6b000b27e7021d8c225d4ddec8e44157670b026
1 parent
2e8427ac
code check third login info
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
7 deletions
apps/passport/controllers/cert.js
apps/passport/models/cert-api.js
apps/passport/models/cert-service.js
public/js/passport/bind/index.js
apps/passport/controllers/cert.js
View file @
e6b000b
...
...
@@ -73,7 +73,7 @@ const cert = {
return
res
.
json
({
code
:
400
,
message
:
''
,
data
:
''
});
}
req
.
ctx
(
CertService
).
certCheck
(
mobile
,
area
,
code
).
then
(({
error
,
result
})
=>
{
req
.
ctx
(
CertService
).
certCheck
(
mobile
,
area
,
code
,
req
.
body
).
then
(({
error
,
result
})
=>
{
if
(
error
)
{
return
res
.
json
({
code
:
400
,
message
:
'短信验证码不正确'
,
data
:
''
});
}
...
...
apps/passport/models/cert-api.js
View file @
e6b000b
...
...
@@ -9,7 +9,7 @@ module.exports = class extends global.yoho.BaseModel {
super
(
ctx
);
}
certCheck
(
mobile
,
area
,
code
)
{
certCheck
(
mobile
,
area
,
code
,
extra
)
{
let
params
=
{
method
:
'app.bind.changeMobileCheck'
,
area
:
area
,
...
...
@@ -17,6 +17,13 @@ module.exports = class extends global.yoho.BaseModel {
code
:
code
};
if
(
extra
.
openId
&&
extra
.
sourceType
)
{
Object
.
assign
(
params
,
{
open_id
:
extra
.
openId
,
source_type
:
extra
.
sourceType
});
}
return
this
.
get
({
data
:
params
});
}
...
...
apps/passport/models/cert-service.js
View file @
e6b000b
...
...
@@ -11,8 +11,8 @@ module.exports = class extends global.yoho.BaseModel {
this
.
certMobile
=
this
.
api
.
certMobile
.
bind
(
this
.
api
);
}
async
certCheck
(
mobile
,
area
,
smsCode
)
{
let
{
code
,
data
}
=
await
this
.
api
.
certCheck
(
mobile
,
area
,
smsCode
);
async
certCheck
(
mobile
,
area
,
smsCode
,
extra
)
{
let
{
code
,
data
}
=
await
this
.
api
.
certCheck
(
mobile
,
area
,
smsCode
,
extra
);
if
(
!
code
||
code
!==
200
)
{
return
{
...
...
public/js/passport/bind/index.js
View file @
e6b000b
...
...
@@ -15,6 +15,9 @@ var $wrapper = $('.bindwrapper'),
$phoneTip
=
$wrapper
.
find
(
'.phone-err-tip'
),
$nextBtn
=
$wrapper
.
find
(
'.yohobindbtn'
);
var
thirdOpenId
=
$
(
'#openId'
).
val
(),
thirdSourceType
=
$
(
'#sourceType'
).
val
();
var
Alert
=
require
(
'../../common/dialog'
).
Alert
;
var
dialog
=
require
(
'../cert/dialog'
);
...
...
@@ -180,8 +183,8 @@ function actionSubmit() {
url
:
'/passport/autouserinfo/bindMobile'
,
data
:
{
area
:
$
(
'#areacode'
).
val
(),
openId
:
$
(
'#openId'
).
val
(),
sourceType
:
$
(
'#sourceType'
).
val
(),
openId
:
thirdOpenId
,
sourceType
:
thirdSourceType
,
nickName
:
$
(
'#nickName'
).
val
(),
mobile
:
$
(
'#mobile'
).
val
(),
code
:
$
(
'#smscode'
).
val
()
...
...
@@ -242,7 +245,9 @@ function nextStep() {
data
:
{
mobile
:
mobile
,
area
:
areaCode
,
code
:
smsCode
code
:
smsCode
,
openId
:
thirdOpenId
,
sourceType
:
thirdSourceType
},
dataType
:
'json'
,
success
:
function
(
data
)
{
...
...
Please
register
or
login
to post a comment