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
Describe the bug 项目clone下来后, 本地运行, 希望api能走本地服务, 因此参考 .env.development 修改了 配置
# base ap # VUE_APP_BASE_API = 'http://local.vma.isocked.com/api' VUE_APP_BASE_API = 'http://127.0.0.1:5005/api'
vue.config.js 配置了devServer
devServer: { host: '127.0.0.1', port: 8000, proxy: { '/api': { target: 'http://127.0.0.1:5005/', ws: false, changeOrigin: true, pathRewrite: { // '/api/': '/api/', }, }, }, },
确实请求到了本地服务, 但不是通过代理, 而是直接跨域到了5005端口的服务.
因为非前端开发, 因此花了大半天的时间才找到原因,
# base ap # VUE_APP_BASE_API = 'http://local.vma.isocked.com/api' VUE_APP_BASE_API = '/api'
即可解决
花了这么长时间一个是因为前端不熟, 再一个是受原始 VUE_APP_BASE_API的配置内容和方式影响, 自然而然的配置了一个带域名的VUE_APP_BASE_API.
VUE_APP_BASE_API
因此希望将 .env.development 的 VUE_APP_BASE_API 改成 /api, 降低出错的概率. 谢谢
/api
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
项目clone下来后, 本地运行, 希望api能走本地服务, 因此参考 .env.development 修改了 配置
vue.config.js 配置了devServer
确实请求到了本地服务, 但不是通过代理, 而是直接跨域到了5005端口的服务.
因为非前端开发, 因此花了大半天的时间才找到原因,
即可解决
花了这么长时间一个是因为前端不熟, 再一个是受原始
VUE_APP_BASE_API
的配置内容和方式影响, 自然而然的配置了一个带域名的VUE_APP_BASE_API.因此希望将 .env.development 的 VUE_APP_BASE_API 改成
/api
, 降低出错的概率. 谢谢The text was updated successfully, but these errors were encountered: