vue.config.js 584 B

1234567891011121314151617181920
  1. const {
  2. defineConfig
  3. } = require('@vue/cli-service')
  4. module.exports = defineConfig({
  5. transpileDependencies: true
  6. })
  7. module.exports = {
  8. devServer: {
  9. proxy: {
  10. '/api': {
  11. // target: 'http://127.0.0.1:9527', // 设置你的后端 API 地址
  12. target: 'http://8.142.173.95:9527', // 设置你的后端 API 地址
  13. changeOrigin: true, // 允许跨域
  14. // pathRewrite: {
  15. // '^/api': '', // 重写请求路径,去掉 '/api'
  16. // },
  17. },
  18. },
  19. },
  20. };