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
Email Patches
Plain Diff
Browse Files
Authored by
陈峰
6 years ago
Commit
d36162725b9b6f3133ebdbe8ef6af44cc1111886
1 parent
5bff9903
commit
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
22 deletions
apps/common/create-api-server.js
apps/pages/single/order/ufo/components/product-item.vue
doraemon/middleware/ssr-api.js
apps/common/create-api-server.js
View file @
d361627
...
...
@@ -34,23 +34,30 @@ const request = async({url, method, reqParams = {}, context}) => {
'User-Agent'
:
'yoho/nodejs'
};
if
(
apiInfo
.
service
)
{
return
await
serviceApi
.
get
(
`
$
{
apiInfo
.
api
}
$
{
apiInfo
.
path
}
`
,
params
,
{
cache
:
cache
,
code
:
200
,
headers
});
}
else
if
(
apiInfo
.
ufo
)
{
return
await
ufoAPI
[
method
](
`
$
{
apiInfo
.
path
||
''
}
`
,
params
,
{
cache
:
cache
,
code
:
200
,
headers
});
}
else
{
return
await
yohoApi
[
method
](
`
$
{
apiInfo
.
path
||
''
}
`
,
params
,
{
code
:
200
,
cache
:
cache
,
headers
try
{
if
(
apiInfo
.
service
)
{
return
await
serviceApi
.
get
(
`
$
{
apiInfo
.
api
}
$
{
apiInfo
.
path
}
`
,
params
,
{
cache
:
cache
,
code
:
200
,
headers
});
}
else
if
(
apiInfo
.
ufo
)
{
return
await
ufoAPI
[
method
](
`
$
{
apiInfo
.
path
||
''
}
`
,
params
,
{
cache
:
cache
,
code
:
200
,
headers
});
}
else
{
return
await
yohoApi
[
method
](
`
$
{
apiInfo
.
path
||
''
}
`
,
params
,
{
code
:
200
,
cache
:
cache
,
headers
});
}
}
catch
(
error
)
{
return
Promise
.
reject
({
code
:
error
.
code
||
500
,
message
:
error
.
message
||
'服务器错误'
});
}
};
...
...
apps/pages/single/order/ufo/components/product-item.vue
View file @
d361627
...
...
@@ -9,7 +9,7 @@
<span class="unit">码</span>
</div>
<div class="middle">
<p class="size-store">¥{{value.goodsInfo.
goodP
rice}},{{value.goodsInfo.storageNum}}个库存</p>
<p class="size-store">¥{{value.goodsInfo.
p
rice}},{{value.goodsInfo.storageNum}}个库存</p>
<p class="low-price">当前最低价¥{{value.goodsInfo.leastPrice}}</p>
</div>
<div class="right">
...
...
doraemon/middleware/ssr-api.js
View file @
d361627
...
...
@@ -71,11 +71,11 @@ module.exports = async(req, res, next) => {
return
res
.
json
({
code
:
400
});
}
catch
(
e
)
{
logger
.
error
(
e
);
}
catch
(
error
)
{
logger
.
error
(
error
);
return
res
.
json
({
code
:
400
,
message
:
e
code
:
error
.
code
||
500
,
message
:
error
.
message
||
'服务器错误'
});
}
};
...
...
Please
register
or
login
to post a comment