最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

返回里面的值.then()[复制]

运维笔记admin19浏览0评论

返回里面的值.then()[复制]

返回里面的值.then()[复制]

这个问题在这里已有答案:

  • Error: Can't set headers after they are sent to the client 23回答
回答如下:

根据明确的文件,https://expressjs/en/api.html#res,您可以这样做:

.then(response => {
   res.send(response).
})

要么

.then(response => {
  res.json(response)
})

在此之前,请检查是否必须使用.asPromise()。

发布评论

评论列表(0)

  1. 暂无评论