import { defineConfig } from 'vite' import uni from '@dcloudio/vite-plugin-uni' export default defineConfig({ plugins: [ uni() ], server: { proxy: { '/prodJavaApi': { target: 'https://cashier.sxczgkj.com', // 目标服务器地址 changeOrigin: true, // 是否更改请求源 rewrite: path => path.replace(/^\/prodJavaApi/, '') }, '/testJavaApi': { target: 'http://192.168.1.42/', // 目标服务器地址 changeOrigin: true, // 是否更改请求源 rewrite: path => path.replace(/^\/testJavaApi/, '') }, '/prodPhpApi': { target: 'https://cashier.sxczgkj.com', // 目标服务器地址 changeOrigin: true, // 是否更改请求源 rewrite: path => path.replace(/^\/prodPhpApi/, '') }, '/testPhpApi': { target: 'http://192.168.1.42:8787/', // 目标服务器地址 changeOrigin: true, // 是否更改请求源 rewrite: path => path.replace(/^\/testPhpApi/, '') } } } })