Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
姜枫
8 years ago
Commit
6b1ec8371c37cc7dc3270b995e74c1aa8173fe12
2 parents
f27c062b
5a62ed49
Merge branch 'release/2.0' into 'master'
fix bug & 百度统计 See merge request
!5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
23 deletions
apps/me/controllers/favorite.js
apps/passport/controllers/login.js
apps/passport/models/login-api.js
doraemon/views/partial/analysis.hbs
apps/me/controllers/favorite.js
View file @
6b1ec83
...
...
@@ -83,7 +83,7 @@ const favorite = {
p
.
stateText
=
'已售罄'
;
p
.
hideBtn
=
true
;
}
p
.
url
=
`
/
product
/
pro_$
{
p
.
product
I
d
}
_$
{
p
.
goodsId
}
/${p.cnAlphabet}.html`
;
p
.
url
=
`
/
product
/
pro_$
{
p
.
product
_i
d
}
_$
{
p
.
goodsId
}
/${p.cnAlphabet}.html`
;
p
.
imageUrl
=
p
.
image
.
replace
(
'imageMogr2'
,
'imageMogr1'
);
});
...
...
apps/passport/controllers/login.js
View file @
6b1ec83
...
...
@@ -316,14 +316,12 @@ const local = {
*/
const
wechat
=
{
login
:
(
req
,
res
,
next
)
=>
{
req
.
session
=
req
.
session
||
{};
req
.
session
.
authState
=
uuid
.
v4
();
return
passport
.
authenticate
(
'wechat'
,
{
state
:
req
.
session
.
authState
state
:
uuid
.
v4
()
})(
req
,
res
,
next
);
},
callback
:
(
req
,
res
,
next
)
=>
{
if
(
req
.
session
&&
req
.
session
.
authState
&&
req
.
session
.
authState
===
req
.
query
.
state
)
{
if
(
req
.
session
)
{
passport
.
authenticate
(
'wechat'
,
(
err
,
user
)
=>
{
if
(
err
)
{
log
.
error
(
`
wechat
authenticate
error
:
$
{
JSON
.
stringify
(
err
)}
`
);
...
...
@@ -349,7 +347,6 @@ const wechat = {
*/
const
sina
=
{
login
:
(
req
,
res
,
next
)
=>
{
req
.
session
=
req
.
session
||
{};
req
.
session
.
authState
=
uuid
.
v4
();
return
passport
.
authenticate
(
'sina'
,
{
state
:
req
.
session
.
authState
...
...
apps/passport/models/login-api.js
View file @
6b1ec83
...
...
@@ -74,7 +74,7 @@ const signinByWechatAsync = (nickname, openId, sourceType, shoppingKey, unionId)
openId
:
openId
,
unionId
:
unionId
,
source_type
:
sourceType
,
method
:
'app.passport.signinBy
Wechat
'
method
:
'app.passport.signinBy
OpenID
'
};
if
(
shoppingKey
)
{
...
...
doraemon/views/partial/analysis.hbs
View file @
6b1ec83
<script>
(
function
(
w
,
d
,
s
,
j
,
f
)
{
var
a
=
d
.
createElement
(
s
);
var
m
=
d
.
getElementsByTagName
(
s
)[
0
];
w
.
YohoAcquisitionObject
=
f
;
w
[
f
]
=
function
()
{
w
[
f
].
p
=
arguments
;
};
a
.
async
=
1
;
a
.
src
=
j
;
m
.
parentNode
.
insertBefore
(
a
,
m
);
}(
window
,
document
,
'script'
,
(
document
.
location
.
protocol
===
'https:'
?
'https'
:
'http'
)
+
'://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js'
,
'yohoblk_web'
));
</script>
\ No newline at end of file
<script>
var
_hmt
=
_hmt
||
[];
(
function
()
{
var
hm
=
document
.
createElement
(
"script"
);
hm
.
src
=
"https://hm.baidu.com/hm.js?aa0a2539863efdcb816742ac181a59ac"
;
var
s
=
document
.
getElementsByTagName
(
"script"
)[
0
];
s
.
parentNode
.
insertBefore
(
hm
,
s
);
})();
</script>
...
...
Please
register
or
login
to post a comment