在做东西时候遇到一个可能会重复输出res.json的地方,重复输出会产生Error:Cannot set header after they are sent. 

Node.js不像c++里可以直接通过return直接结束函数运行。

 

但其实只要 return res.json();就可以了。

相关文章:

  • 2021-10-15
  • 2021-12-10
  • 2022-12-23
  • 2021-04-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2023-01-10
  • 2022-12-23
  • 2021-12-26
  • 2022-03-10
  • 2022-12-23
  • 2023-03-24
相关资源
相似解决方案