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
王水玲
9 years ago
Commit
e94ab43e73d3a829bfe28810ea5110e62c2c67ce
1 parent
574a2cc8
登录
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
apps/passport/auth.js
apps/passport/controllers/login.js
apps/passport/auth.js
View file @
e94ab43
...
...
@@ -83,7 +83,7 @@ passport.use('local', new LocalStrategy({
}
else
if
(
ipTimes
>=
100
)
{
done
({
message
:
'您尝试的次数过多,账号已被暂时锁定,请稍后再试'
},
null
);
}
else
{
return
AuthHelper
.
signin
Aes
(
area
,
username
,
password
,
shoppingKey
).
then
((
result
)
=>
{
return
AuthHelper
.
signin
(
area
,
username
,
password
,
shoppingKey
).
then
((
result
)
=>
{
if
(
result
.
code
&&
result
.
code
===
200
&&
result
.
data
.
uid
)
{
cache
.
del
(
errorLoginKey
);
...
...
apps/passport/controllers/login.js
View file @
e94ab43
...
...
@@ -103,6 +103,16 @@ const local = {
// 设置登录有效时间30分钟, 防机器刷,cache不稳定,改为cookie
res
.
cookie
(
'LE'
+
md5
(
'_LOGIN_EXPIRE'
),
(
new
Date
()).
getTime
()
/
1000
+
1800
);
console
.
log
(
req
.
user
.
uid
)
// 清除cookie
res
.
clearCookie
(
'_UID'
,
{
domain
:
'yohobuy.com'
});
res
.
clearCookie
(
'_TOKEN'
,
{
domain
:
'yohobuy.com'
});
let
bindMobile
=
_
.
trim
(
req
.
query
.
bindMobile
||
''
);
let
bindArea
=
'+'
+
_
.
trim
(
req
.
query
.
bindArea
||
'86'
);
let
areaArr
=
PassportHelper
.
getCountry
();
...
...
Please
register
or
login
to post a comment