Laravel路由url和vuejs急于处理Unicode utf-8问题

问题描述 投票:-1回答:2

我在slug中使用我的项目。当我使用英语时效果很好。但是当我使用unicode / bangla时,其显示在这张照片中。enter image description here急于不工作

laravel vue.js axios
2个回答
0
投票

已解决急发送的请求:axios.get(en/blog/${encodeURI(this.$route.params.id)})。then(response => {this.blogpostdetails = response.data.blogpostdetails;

});

和控制器:$ blogpost = Blog :: with('blogcategorylist','admin','blogcomment')-> whereSlug(urldecode($ id))-> get()-> first();


-1
投票

这样更改您的请求会有所帮助

 let url = http://127.0.0.1:8000/en/blog/${this.$route.params.id};
 axios.get(encodeURI(url))

并且在您的控制器中照常使用它

© www.soinside.com 2019 - 2024. All rights reserved.