在vue的项目中axios为什么传不回来数据啊


created () {
    console.log('created', this.$route.params.id)
    axios({
      // eslint-disable-next-line no-template-curly-in-string
      url: 'https://m.maizuo.com/gateway?filmId=${this.$route.params.id}&k=930931',
      headers: {
        'X-Client-Info': '{"a":"3000","ch":"1002","v":"5.2.0","e":"16466636386676260373659649","bc":"110100"}',
        'X-Host': 'mall.film-ticket.film.info'
      }
    }).then(res => {
      console.log(res.data)
    })
  }

为什么传回来的数据中msg是这样的啊
created 5863
Detail.vue?a2a1:19 {status: 1001, data: '', msg: '参数错误'}
明明this.$route.params.id已经可以传回来了,但是url用的时候又没用,这是错哪里了
如果把url改成 url: 'https://m.maizuo.com/gateway?filmId=5863&k=930931'又只能传回来一个数据

url写错了。是``,不是'',有用的话希望采纳一下


`https://m.maizuo.com/gateway?filmId=${this.$route.params.id}&k=930931`

很明显的错误,你这是字符串,里面是Es6的拼接,你需要改成

 
`https://m.maizuo.com/gateway?filmId=${this.$route.params.id}&k=930931`