AA周年庆后台前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
880 B

1 month ago
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. import path from 'path'
  4. export default defineConfig({
  5. plugins: [vue()],
  6. resolve: {
  7. alias: {
  8. '@': path.resolve(__dirname, './src')
  9. }
  10. },
  11. // server: {
  12. // proxy: {
  13. // '/api': {
  14. // target: 'http://39.98.127.73',
  15. // changeOrigin: true,
  16. // rewrite: (path) => path.replace(/^\/api/, '/price/admin'),
  17. // },
  18. // },
  19. // },
  20. server: {
  21. proxy: {
  22. '/api': {
  23. target: 'https://dbqb.nfdxy.net/devLotApi', // 后端基础地址
  24. changeOrigin: true,
  25. rewrite: (path) => path.replace(/^\/api/, ''), // 移除 /api 前缀
  26. // 或者更精确的重写(根据后端路径调整):
  27. // rewrite: (path) => path.replace(/^\/api\/admin/, '/admin'),
  28. },
  29. },
  30. },
  31. })