购物车下单后无法跳转到订单详情页
// 下单
axios.post('{{ route('orders.store') }}', req)
.then(function (response) {
console.log(response);
swal('订单提交成功', '', 'success')
.then(() => {
location.herf = '/orders/' + response.data.id;
});
},
...
下单成功后无法自动跳转到订单详情页,location.herf = '/orders/' + response.data.id;
似乎这种写法都没法直接跳转,换成route('orders.index')
的话可以跳到订单列表,但是要调到订单详情的话,通过location.herf = '{{ route('orders.show', [response.data]) }}';
这样也还是不行,所以想请教下这个是什么情况?
推荐文章: