使用curl转发请求的时候,会404异常
DricHao opened this issue · comments
J commented
const data = await ctx.curl(app.config.baseUri + href, { method: ctx.method, dataType: 'json', headers: ctx.header, }) console.log('成功'); ctx.body = 'good';
只要把ctx.body放在curl请求之前就会请求到'good',放在它之后就是请求404,这是怎么回事?cur请求是能够正常请求到数据的
Mr-Groundhog commented
看看是不是中间件的执行顺序问题
TZ | 天猪 commented
提供下最小可复现仓库
Shixucheng commented
解决了吗
TZ | 天猪 commented
用 npm init egg --type=simple
初始化个最小可复现仓库,然后提交到你的 GitHub 吧。
先关了,有可复现的最小仓库再重新打开