我把解析query那里改成1之后还是返回undefined是怎么回事啊

来源:5-11 开发路由(删除博客路由和登录路由)

珍妮玛一黛金

2022-02-23

输入正文

写回答

2回答

双越

2022-02-25

你执行 req.url 获取 undefined ?这个比较奇怪

要不你参考一下讲师源代码试试 https://git.imooc.com/coding-320/nodejs-myblog/src/master/code-demo/blog-1 

0
1
珍妮玛一黛金
找到问题了老师,我一时粗心测试的时候忘记写id=3了,刚才调回去又重新看了一遍才发现
2022-02-27
共1条回复

双越

2022-02-24

把关键代码贴出来吧

0
4
珍妮玛一黛金
回复
双越
(node:19380) UnhandledPromiseRejectionWarning: ReferenceError: url is not defined at updateBlog (F:\VScode项目库\nodejs\blog-1\src\controller\blog.js:43:15) at handleBlogRouter (F:\VScode项目库\nodejs\blog-1\src\router\blog.js:35:20) at getPostData.then.postData (F:\VScode项目库\nodejs\blog-1\app.js:50:22) at process._tickCallback (internal/process/next_tick.js:68:7) (node:19380) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:19380) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
2022-02-24
共4条回复

Node.js+Express+Koa2+Nest.js 开发服务端

从入门到实战,一站式掌握 Node.js+Express+Koa2

4051 学习 · 2006 问题

查看课程