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
王水玲
9 years ago
Commit
8eb612d3f05ef0236ef8fa3ae281ee12a4a4d1af
1 parent
8b62f24d
第三方绑定
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
15 deletions
apps/passport/controllers/back.js
apps/passport/controllers/bind.js
apps/passport/controllers/login.js
apps/passport/controllers/reg.js
apps/passport/models/auth-helper.js
apps/passport/models/back-api.js
apps/passport/models/reg-service.js
public/scss/passport/_success.css
apps/passport/controllers/back.js
View file @
8eb612d
...
...
@@ -283,7 +283,6 @@ const setNewPasswordByMobileAPI = (req, res, next) => {
service
.
modifyPasswordByMobileAsync
(
phoneNum
,
token
,
newPwd
,
areaCode
)
.
then
(
result
=>
{
console
.
log
(
result
);
if
(
result
.
code
===
200
)
{
res
.
json
({
code
:
200
,
...
...
apps/passport/controllers/bind.js
View file @
8eb612d
...
...
@@ -200,10 +200,14 @@ const bind = {
let
refer
=
helpers
.
urlFormat
(
'/passport/bind/success'
,
{
sourceType
:
sourceType
});
if
(
result
&&
result
.
code
&&
result
.
code
===
200
&&
result
.
data
.
uid
)
{
AuthHelper
.
syncUserSession
(
result
.
data
.
uid
,
req
,
res
);
return
AuthHelper
.
syncUserSession
(
result
.
data
.
uid
,
req
,
res
).
then
(()
=>
{
result
.
data
.
refer
=
refer
;
}
return
result
;
});
}
else
{
return
{
code
:
400
,
message
:
'绑定失败'
,
data
:
''
};
}
}).
then
(
result
=>
{
res
.
json
(
result
);
}).
catch
(
next
);
...
...
apps/passport/controllers/login.js
View file @
8eb612d
...
...
@@ -211,6 +211,7 @@ const qq = {
log
.
error
(
`
qq
authenticate
error
:
$
{
JSON
.
stringify
(
err
)}
`
);
return
res
.
redirect
(
loginPage
);
}
let
nickname
=
user
.
nickname
;
let
openId
=
user
.
id
;
...
...
apps/passport/controllers/reg.js
View file @
8eb612d
apps/passport/models/auth-helper.js
View file @
8eb612d
...
...
@@ -22,7 +22,7 @@ class Auth {
static
signinAes
(
area
,
profile
,
password
,
shoppingKey
)
{
let
param
=
{
method
:
'app.passport.signin'
,
method
:
'app.passport.signin
AES
'
,
area
:
area
,
profile
:
profile
,
password
:
aes
.
aesPwd
(
password
)
...
...
apps/passport/models/back-api.js
View file @
8eb612d
...
...
@@ -6,6 +6,7 @@
const
api
=
global
.
yoho
.
API
;
const
aes
=
require
(
'./aes-pwd'
);
const
YOHOBUY_URL
=
'http://www.yohobuy.com/'
;
...
...
@@ -113,6 +114,16 @@ const modifyPasswordByMobileAsync = (mobile, token, newpwd, area) => {
});
};
const
modifyPasswordByMobileAsyncAes
=
(
mobile
,
token
,
newpwd
,
area
)
=>
{
return
api
.
get
(
''
,
{
mobile
:
mobile
,
token
:
token
,
newpwd
:
aes
.
aesPwd
(
newpwd
),
area
:
area
,
method
:
'app.register.changepwdByMobileCodeAES'
});
};
module
.
exports
=
{
getAreaDataAsync
,
sendCodeToEmailAsync
,
...
...
apps/passport/models/reg-service.js
View file @
8eb612d
...
...
@@ -8,6 +8,7 @@
'use strict'
;
const
api
=
global
.
yoho
.
API
;
const
aes
=
require
(
'./aes-pwd'
);
const
RegService
=
{
getAreaData
()
{
...
...
@@ -94,6 +95,20 @@ const RegService = {
}
return
api
.
post
(
''
,
params
);
},
regMobileEas
(
area
,
mobile
,
password
,
shoppingKey
)
{
let
params
=
{
method
:
'app.passport.registerAES'
,
area
:
area
,
profile
:
mobile
,
password
:
aes
.
aesPwd
(
password
)
};
if
(
shoppingKey
)
{
params
.
shopping_key
=
shoppingKey
;
}
return
api
.
post
(
''
,
params
);
}
};
...
...
public/scss/passport/_success.css
View file @
8eb612d
...
...
@@ -2,28 +2,28 @@
color
:
#fefefe
;
.success-icon
{
width
:
74px
;
height
:
74px
;
margin
:
60px
auto
30px
;
width
:
74
PX
;
height
:
74
PX
;
margin
:
60
PX
auto
30
PX
;
background
:
resolve
(
"passport/success.png"
);
background-size
:
100%
;
}
.success-tip
{
padding
:
10px
;
font-size
:
16px
;
padding
:
10
PX
;
font-size
:
16
PX
;
line-height
:
1.5
;
}
.go
{
display
:
block
;
margin
:
30px
auto
;
width
:
270px
;
height
:
40px
;
font-size
:
14px
;
line-height
:
40px
;
margin
:
30
PX
auto
;
width
:
270
PX
;
height
:
40
PX
;
font-size
:
14
PX
;
line-height
:
40
PX
;
color
:
#fff
;
background
:
rgba
(
255
,
255
,
255
,
0.4
);
border-radius
:
5
px
;
border-radius
:
5
PX
;
}
}
...
...
Please
register
or
login
to post a comment