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
Plain Diff
Browse Files
Authored by
陈峰
6 years ago
Commit
53eda6585e3cc6b9d9de5386f6bfb6f791b9b1b6
2 parents
9780d441
76634acb
Merge branch 'hotfix/limit' into 'release/6.7.9'
Hotfix/limit See merge request
!385
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
app.js
apps/passport/models/login-service.js
apps/product/models/shop-service.js
app.js
View file @
53eda65
...
...
@@ -77,6 +77,9 @@ app.use((req, res, next) => {
next
();
});
app
.
use
(
favicon
(
path
.
join
(
__dirname
,
'/favicon.ico'
)));
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'static'
)));
// 添加请求上下文
app
.
use
(
global
.
yoho
.
httpCtx
());
...
...
@@ -90,8 +93,6 @@ app.use(global.yoho.hbs({
cb
:
hbsEvent
.
cb
}));
app
.
use
(
favicon
(
path
.
join
(
__dirname
,
'/favicon.ico'
)));
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'static'
)));
app
.
use
(
bodyParser
.
json
());
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}));
app
.
use
(
cookieParser
());
...
...
apps/passport/models/login-service.js
View file @
53eda65
...
...
@@ -83,17 +83,17 @@ module.exports = class extends global.yoho.BaseModel {
let
saltedToken
=
sign
.
makeToken
(
saltedUid
);
let
publicToken
=
saltedToken
+
salt
;
let
data
=
userInfo
.
data
;
let
data
=
userInfo
.
data
||
{}
;
if
(
!
data
)
{
throw
Error
(
'app.passport.profile api error'
);
if
(
!
userInfo
.
data
)
{
// 个新信息接口可能限流,即使限流也仍然可以登录
logger
.
error
(
`
app
.
passport
.
profile
api
error
【
$
{
uid
}
】`
);
}
let
encryptionUid
=
aes
.
encryptionUid
(
data
.
uid
);
let
encryptionUid
=
aes
.
encryptionUid
(
uid
);
let
uidCookie
=
`
$
{
encodeURIComponent
(
data
.
profile_name
)}::
$
{
encryptionUid
}
::
$
{
_
.
get
(
data
,
'vip_info.title'
,
''
)}
::
$
{
saltedToken
}
`
;
// eslint-disable-line
`
$
{
encodeURIComponent
(
data
.
profile_name
||
''
)}
::
$
{
encryptionUid
}
::
$
{
_
.
get
(
data
,
'vip_info.title'
,
''
)}
::
$
{
saltedToken
}
`
;
// eslint-disable-line
let
isStudent
=
_
.
get
(
data
,
'vip_info.is_student'
)
||
0
;
res
.
cookie
(
'_UID'
,
uidCookie
,
{
...
...
apps/product/models/shop-service.js
View file @
53eda65
...
...
@@ -353,12 +353,13 @@ function getShopInfoAsync(domain, channel, params) {
if
(
shopId
)
{
// 带id访问
let
result
=
yield
this
.
api
.
getShopInfo
(
shopId
);
data
=
result
.
data
;
data
=
result
.
data
||
{}
;
// 根据店铺ID,未取到店铺信息,跳转至首页
if
(
result
.
code
!==
200
||
_
.
isEmpty
(
data
))
{
return
{
redirect
:
helpers
.
urlFormat
(
''
)};
}
// if (result.code !== 200 || _.isEmpty(data)) {
// return {redirect: helpers.urlFormat('')};
// }
// intro接口可能被限流但页面要展示
let
lowerDomain
=
_
.
toLower
(
data
.
shop_domain
);
...
...
Please
register
or
login
to post a comment