期初数据前台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

vite.config.js 519B

12345678910111213141516171819202122
  1. import { defineConfig } from 'vite'
  2. import vue from '@vitejs/plugin-vue'
  3. export default defineConfig({
  4. plugins: [vue()],
  5. server: {
  6. port: 3000,
  7. host: 'localhost', // 明确指定host
  8. proxy: {
  9. '/api': {
  10. target: 'http://localhost:8080',
  11. changeOrigin: true,
  12. secure: false,
  13. configure: (proxy, options) => {
  14. proxy.on('proxyReq', (proxyReq, req, res) => {
  15. console.log('代理请求:', req.method, req.url)
  16. })
  17. }
  18. }
  19. }
  20. }
  21. })