| 123456789101112131415161718 |
- import { defineConfig } from 'vite'
- import uni from '@dcloudio/vite-plugin-uni'
- // H5 dev: 通过 Vite 代理把 /api 转发到后端,避开浏览器 CORS。
- // 接入新后端时,把 API_TARGET 改成对应环境即可。
- const API_TARGET = 'http://aiot.zoomwin.com.cn:51001'
- export default defineConfig({
- plugins: [uni()],
- server: {
- proxy: {
- '/api': {
- target: API_TARGET,
- changeOrigin: true,
- },
- },
- },
- })
|