1 Star 0 Fork 0

huangchengcheng / AgentShow

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vue.config.js 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
huangchengcheng 提交于 2020-09-04 13:46 . Last demo
// 配置
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",
// }
// }
// }
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huangchengcheng98/AgentShow.git
git@gitee.com:huangchengcheng98/AgentShow.git
huangchengcheng98
AgentShow
AgentShow
master

搜索帮助