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.

48 lines
1.1 KiB

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