vue-cli3.0无config,js跨域解决
在根目录下创建vue.config.js
module.exports = {
runtimeCompiler: true,
publicPath: '/', //设置打包路径
devServer: {
host: 'local-sys.zzzzi.cn', // 自定义域名,大家可以写localhost,端口号写8080
port: 10100,
open: true,
https: false,
// 设置开发接口代理
proxy: {
"/api/v1": {
target: 'http://10.10.1.122:8080', // 接口的地址
ws: true,
changeOrigin: true,
}
}
}
}