vue.config.js 557 B

123456789101112131415161718
  1. const { defineConfig } = require('@vue/cli-service')
  2. module.exports = defineConfig({
  3. transpileDependencies: true,
  4. productionSourceMap: false,
  5. devServer: {
  6. proxy: {
  7. '/api': { //这里最好有一个 /
  8. target: 'http://121.5.58.50:8080', // 后台接口域名
  9. ws: true, //如果要代理 websockets,配置这个参数
  10. secure: false, // 如果是https接口,需要配置这个参数
  11. changeOrigin: true, //是否跨域
  12. pathRewrite: {
  13. '^/api': ''
  14. }
  15. }
  16. }
  17. },
  18. })