设置代理

  1. import { defineConfig } from 'vite';
  2. export default defineConfig({
  3. server: {
  4. proxy: {
  5. "/api": {
  6. target: "http://localhost:8080"
  7. }
  8. }
  9. }
  10. })