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
陈峰
8 years ago
Commit
f7a713b999719a4ccbe02332bf24cc3188a39f90
1 parent
79ac8d9e
微信退出后不自动登录
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
apps/passport/controllers/login.js
apps/passport/controllers/login.js
View file @
f7a713b
...
...
@@ -78,7 +78,9 @@ const common = {
next
();
},
weixinCheck
:
(
req
,
res
,
next
)
=>
{
if
(
req
.
yoho
.
isWechat
)
{
let
passLogin
=
_
.
get
(
req
,
'cookies._WX_PASS_LOGIN'
,
false
);
if
(
req
.
yoho
.
isWechat
&&
!
passLogin
)
{
return
res
.
redirect
(
'/passport/login/wechat'
);
}
next
();
...
...
@@ -256,10 +258,12 @@ const local = {
domain
:
'yohobuy.com'
});
res
.
clearCookie
(
'_SPK'
);
res
.
cookie
(
'_WX_PASS_LOGIN'
,
true
,
{
domain
:
'm.yohobuy.com'
});
let
refer
=
req
.
get
(
'Referer'
)
||
config
.
siteUrl
;
refer
=
utils
.
refererLimit
(
refer
);
res
.
redirect
(
refer
);
}
};
...
...
@@ -269,6 +273,9 @@ const wechat = {
// 设置为原链接标识originalUrl
req
.
session
.
originalUrl
=
'true'
;
req
.
session
.
authState
=
uuid
.
v4
();
res
.
clearCookie
(
'_WX_PASS_LOGIN'
,
{
domain
:
'm.yohobuy.com'
});
return
passport
.
authenticate
(
'weixin'
,
{
state
:
req
.
session
.
authState
})(
req
,
res
,
next
);
...
...
Please
register
or
login
to post a comment