7-3: 获取电影详情页的时候,传入id,但是获取到的params为undefined,但是奇怪的是,它能正确定位到指定电影的详情页.
为什么this.params会是undefined?
下面是我打印的get请求的this值.
{ request:
{ method: 'GET',
url: '/movie/undefined',
header:
{ host: '17f5a3c0.viphk.ngrok.org',
connection: 'keep-alive',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
'x-requested-with': 'ShockwaveFlash/23.0.0.207',
accept: '*/*',
referer: 'http://17f5a3c0.viphk.ngrok.org/movie/58b6298427b8642bd89466c4',
'accept-encoding': 'gzip, deflate, sdch',
'accept-language': 'zh-CN,zh;q=0.8' } },
response: { status: 404, message: 'Not Found', header: {} },
app: { subdomainOffset: 2, proxy: false, env: 'development' },
originalUrl: '/movie/undefined',
req: '<original node req>',
res: '<original node res>',
socket: '<original node socket>' }