We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在网上看了一下Vue.axios教程,为什么this.axios.get('/api/hot')就可以获得返回,不用设置baseURL吗?
this.axios.defaults.baseURL = 'http://music.qq.com/musicbox/shop/v3/data/hit'; this.axios.get('/hit_newsong.js') .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); });
没看懂axios,写了一下,可以获得返回但是提示存在跨域问题。不懂axios在这个项目怎么访问接口
The text was updated successfully, but these errors were encountered:
@gzyhelloworld 你好,前端页面直接请求QQ音乐接口是会有跨域限制的,所以我在后端Express(自己上线版本是Koa2)里面做了一个代理一样,由后端去请求那些api,然后返回给前端页面,代码部分在https://github.com/microzz/vue-music-player/blob/2.0.0/build/dev-server.js 这个文件内😄
Sorry, something went wrong.
这是vue-cli搭建的项目中会有一个地方专门写代理
No branches or pull requests
在网上看了一下Vue.axios教程,为什么this.axios.get('/api/hot')就可以获得返回,不用设置baseURL吗?
没看懂axios,写了一下,可以获得返回但是提示存在跨域问题。不懂axios在这个项目怎么访问接口
The text was updated successfully, but these errors were encountered: