代码拉取完成,页面将自动刷新
// 配置
module.exports = {
publicPath:"/",
configureWebpack: {
resolve: {
//省略文件后缀
// extensions: {},
//配置文件别名
alias: {
'assets': '@/assets',
'common': '@/common',
'components': '@/components',
'network': '@/network',
}
},
devServer: {
disableHostCheck: true,
open: false,
host: 'localhost',
port: 8080,
https: false,
//以上的ip和端口是我们本机的;下面为需要跨域的
proxy: { //配置跨域
'/api': {
target: 'http://localhost:3000/addJson/', //这里后台的地址模拟的;应该填写你们真实的后台接口
ws: true,
changOrigin: true, //允许跨域
pathRewrite: {
'^/api': '' //请求的时候使用这个api就可以
}
}
}
},
// proxyTable: {
// '^/api': {
// target: 'http://127.0.0.1:3000',//后端接口地址
// changeOrigin: true,//是否允许跨越
// pathRewrite: {
// "^/api" : "/addJson",
// }
// }
// }
}
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。