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
46b40a3dcd759ea2650688c288277406330d6774
1 parent
08ecbabe
commit
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
apps/common/create-api-server.js
doraemon/middleware/ssr-api.js
apps/common/create-api-server.js
View file @
46b40a3
...
...
@@ -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
...
...
doraemon/middleware/ssr-api.js
View file @
46b40a3
...
...
@@ -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
...
...
Please
register
or
login
to post a comment