import { defineConfig } from 'vite' import uni from '@dcloudio/vite-plugin-uni' //官方内置的,不用下载,下面代码粘贴直接用即可 export default defineConfig({ plugins: [ uni() ], server: { port: 1314, proxy: { '/api': { target: 'http://192.168.1.106:8518/', // 目标服务 changeOrigin: true, rewrite: path => path.replace(/^\/api/, ''), }, } } })