25 lines
500 B
JavaScript
25 lines
500 B
JavaScript
import {
|
|
defineConfig
|
|
} from 'vite'
|
|
import uni from '@dcloudio/vite-plugin-uni'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
uni()
|
|
],
|
|
server: {
|
|
proxy: {
|
|
'/testApi': {
|
|
target: 'http://192.168.1.42', // 目标服务
|
|
changeOrigin: true,
|
|
rewrite: path => path.replace(/^\/testApi/, ''),
|
|
},
|
|
"/proApi": {
|
|
// 需要被代理的后台地址
|
|
target: "https://cashier.sxczgkj.com",
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/proApi/, '')
|
|
},
|
|
}
|
|
}
|
|
}) |