解决跨域
生产环境和开发环境一次解决跨域问题
在config 文件夹里面新建一个 api.config.js 配置文件
1 | const isPro = Object.is(process.env.NODE_ENV, 'production') |
然后在main.js 里面引入,这样可以保证动态的匹配生产和开发的定义前缀
1 | import apiConfig from '../config/api.config' |
- Post title:解决跨域
- Post author:Mark
- Create time:2020-12-19 20:03:49
- Post link:https://m.iqimeng.com/2020/12/19/Vue/解决跨域/
- Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.