import { defineConfig } from '@vben/vite-config'; export default defineConfig(async () => { return { application: {}, vite: { server: { proxy: { '/api': { target: 'https://xz.dhdjy.com', changeOrigin: true, secure: true, // https 接口设为 true ws: true, // 不需要 rewrite,因为 API 定义中已经包含了 /api 前缀 // 请求 /api/admin/login 会转发到 https://xuanzuo.dhdjy.com/api/admin/login }, }, }, }, }; });