You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
frontend/vue.config.js

22 lines
698 B
JavaScript

2 years ago
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
publicPath: '/',
assetsDir: 'static',
transpileDependencies: true,
lintOnSave:false,
devServer: {
proxy: {
'/api': {//表示拦截以/api开头的请求路径
//target: 'http://localhost:1234', //本地nodejs服务器
//target: 'http://47.96.238.157:8093', //公司项目服务器环境
target: 'http://180.166.218.222:7200',
changOrigin: true,//是否开启跨域
pathRewrite: {
'^/api': '' //重写api把api变成空字符因为我们真正请求的路径是没有api的
}
}
}
}
})