diff --git a/vite.config.ts b/vite.config.ts index 073b6db..e29e468 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,6 +4,8 @@ import { fileURLToPath, URL } from 'node:url'; import { defineConfig, ProxyOptions } from 'vite'; import vueDevTools from 'vite-plugin-vue-devtools'; +const SERVER_PORT = 9763; + type ProxyItem = { key: string; target: string; @@ -198,7 +200,8 @@ const apiProxyList: ProxyItem[] = [ ...line04ApiProxyList, { key: '/minio', target: 'http://10.18.128.10:9000', rewrite: ['/minio', ''] }, - { key: '/api', target: 'http://10.18.128.10:18760' }, + { key: '/api', target: 'http://10.18.128.10:18760' }, // 吴中路控制中心 + // { key: '/api', target: 'http://10.18.187.10:18760' }, // 紫藤路 { key: '/ws', target: 'ws://10.18.128.10:18103', ws: true }, ...line10ApiProxyList, @@ -207,6 +210,13 @@ const apiProxyList: ProxyItem[] = [ // { key: '/api', target: 'http://10.24.0.10:18760' }, // { key: '/ws', target: 'ws://10.24.0.10:18103', ws: true }, ...line21YangpuTestProxyList, + + // 设备树测试用代理配置 + // { key: '/vimp/api', target: 'http://10.14.0.10:18080', rewrite: ['/vimp/api', '/api'] }, + // { key: '/vimp/api', target: 'http://10.18.128.6:18080', rewrite: ['/vimp/api', '/api'] }, + { key: '/vimp/api', target: 'http://localhost:4000', rewrite: ['/vimp/api', '/api'] }, + // { key: '/vimp/api', target: 'http://10.18.128.6:18080', rewrite: ['/vimp/api', '/api'] }, + { key: '/cdn', target: `http://localhost:${SERVER_PORT}`, rewrite: ['/cdn', ''] }, ]; // https://vite.dev/config/ @@ -232,7 +242,7 @@ export default defineConfig((/* { command, mode } */) => { }, }, server: { - port: 9763, + port: SERVER_PORT, proxy: viteProxy, }, };