ssr api method default
Showing
1 changed file
with
2 additions
and
1 deletions
@@ -24,6 +24,7 @@ module.exports = () => { | @@ -24,6 +24,7 @@ module.exports = () => { | ||
24 | const reqParams = Object.assign({}, req.query, req.body, baseParams); | 24 | const reqParams = Object.assign({}, req.query, req.body, baseParams); |
25 | const params = checkParams.getParams(reqParams, apiInfo); | 25 | const params = checkParams.getParams(reqParams, apiInfo); |
26 | const cache = req.method.toLowerCase() !== 'get' ? false : apiInfo.cache; | 26 | const cache = req.method.toLowerCase() !== 'get' ? false : apiInfo.cache; |
27 | + let method = req.method.toLowerCase() === 'post' ? 'post' : 'get'; | ||
27 | 28 | ||
28 | let result; | 29 | let result; |
29 | 30 | ||
@@ -33,7 +34,7 @@ module.exports = () => { | @@ -33,7 +34,7 @@ module.exports = () => { | ||
33 | code: 200 | 34 | code: 200 |
34 | }); | 35 | }); |
35 | } else { | 36 | } else { |
36 | - result = await api[req.method.toLowerCase()]('', params, { | 37 | + result = await api[method]('', params, { |
37 | code: 200, | 38 | code: 200, |
38 | cache: cache | 39 | cache: cache |
39 | }); | 40 | }); |
-
Please register or login to post a comment