Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-app-web
·
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
htoooth
6 years ago
Commit
cb724f090a3f029a59d6338571724c04126d95be
2 parents
d826dc2b
46b40a3d
Merge branch 'feature/ufo' of
http://git.yoho.cn/fe/yoho-app-web
into feature/ufo
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
7 deletions
apps/common/create-api-server.js
apps/pages/single/coupon/yoho/list.vue
apps/store/ufo/order/mutations.js
apps/store/yoho/index.js
apps/utils/error-handler.js
doraemon/middleware/ssr-api.js
doraemon/middleware/ssr.js
apps/common/create-api-server.js
View file @
cb724f0
...
...
@@ -36,19 +36,19 @@ const request = async({url, method, reqParams, context}) => {
};
if
(
apiInfo
.
service
)
{
return
await
serviceApi
.
get
(
apiInfo
.
api
,
params
,
{
return
await
serviceApi
.
get
(
`
$
{
apiInfo
.
api
}
$
{
apiInfo
.
path
}
`
,
params
,
{
cache
:
cache
,
code
:
200
,
headers
});
}
else
if
(
apiInfo
.
ufo
)
{
return
await
ufoAPI
[
method
](
''
,
params
,
{
return
await
ufoAPI
[
method
](
`
$
{
apiInfo
.
path
}
`
,
params
,
{
cache
:
cache
,
code
:
200
,
headers
});
}
else
{
return
await
yohoApi
[
method
](
''
,
params
,
{
return
await
yohoApi
[
method
](
`
$
{
apiInfo
.
path
}
`
,
params
,
{
code
:
200
,
cache
:
cache
,
headers
...
...
apps/pages/single/coupon/yoho/list.vue
View file @
cb724f0
...
...
@@ -104,7 +104,8 @@ export default {
}
],
scrollOptions: {
directionLockThreshold: 0
directionLockThreshold: 0,
stopPropagation: true
},
slideOptions: {
listenScroll: true,
...
...
apps/store/ufo/order/mutations.js
View file @
cb724f0
...
...
@@ -21,4 +21,13 @@ export default {
[
Types
.
POST_NOSALE_SUCCESS
](
state
)
{
state
.
fetchingNoSale
=
false
;
},
[
Types
.
POST_CHANGEPRICE_REQUEST
](
state
)
{
state
.
fetchingNoSale
=
true
;
},
[
Types
.
POST_CHANGEPRICE_FAILD
](
state
)
{
state
.
fetchingNoSale
=
false
;
},
[
Types
.
POST_NOSALE_SUCCESS
](
state
)
{
state
.
fetchingNoSale
=
false
;
},
};
...
...
apps/store/yoho/index.js
View file @
cb724f0
...
...
@@ -18,7 +18,7 @@ export default function() {
pageVisible
:
false
,
touchStatus
:
''
,
scrollTime
:
0
,
direction
:
'forword'
direction
:
'forword'
,
},
mutations
:
{
[
Types
.
SET_ENV
]()
{
...
...
apps/utils/error-handler.js
View file @
cb724f0
export
default
err
=>
{
}
\ No newline at end of file
...
...
doraemon/middleware/ssr-api.js
View file @
cb724f0
...
...
@@ -48,6 +48,7 @@ module.exports = async(req, res, next) => {
}
else
if
(
apiInfo
.
ufo
)
{
result
=
await
apiCtx
[
method
]({
api
:
ufoAPI
,
url
:
apiInfo
.
path
,
data
:
params
,
param
:
{
code
:
200
,
...
...
@@ -57,6 +58,7 @@ module.exports = async(req, res, next) => {
}
else
{
result
=
await
apiCtx
[
method
]({
data
:
params
,
url
:
apiInfo
.
path
,
param
:
{
code
:
200
,
cache
:
cache
...
...
doraemon/middleware/ssr.js
View file @
cb724f0
...
...
@@ -56,12 +56,11 @@ const handlerError = (err = {}, req, res, next) => {
}
else
if
(
err
.
code
===
500
)
{
return
res
.
redirect
(
'/error/500'
);
}
console
.
log
(
err
)
return
next
(
err
);
};
const
getCacheKey
=
(
urlPath
,
cackeKey
=
''
)
=>
{
const
urlObj
=
url
.
parse
(
urlPath
);
const
urlObj
=
url
.
parse
(
urlPath
);
return
md5
(
cackeKey
.
replace
(
'$url'
,
urlObj
.
pathname
)
...
...
Please
register
or
login
to post a comment