vue.config.js 339 B

1234567891011121314
  1. module.exports = {
  2. devServer: {
  3. proxy: {
  4. '/api': {
  5. target: 'http://121', // 设置代理目标
  6. changeOrigin: true, // 允许跨域
  7. pathRewrite: {
  8. '^/api': '' // 将 /api 前缀替换为空字符串,实际请求时将不包含 /api
  9. }
  10. }
  11. }
  12. }
  13. };