Skip to content
New issue

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

新手求教怎么跨域访问啊 #5

Open
mengfanxin opened this issue May 25, 2018 · 1 comment
Open

新手求教怎么跨域访问啊 #5

mengfanxin opened this issue May 25, 2018 · 1 comment

Comments

@mengfanxin
Copy link

我把demo下载下来了,运行的时候,首页数据不显示,打开调试器看了一下,发现:
Failed to load https://api.it919.cn/index.php/api/News/banner: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:800' is therefore not allowed access.

Failed to load https://api.it919.cn/index.php/api/News/new_list?page=20&type=0: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:800' is therefore not allowed access.

出现这两条错误
这明显是跨域访问出错的问题啊,请问怎么解决啊。我是个纯VUE新手,,,求指教啊

@mengfanxin
Copy link
Author

我自己解决了,哈哈哈哈

axios.defaults.baseURL = Proxy + 'https://api.it919.cn/index.php/api'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant