#
luxiaotao1123
2024-11-25 526399abe94e3b18e1f886737922d3e491c76b0f
#
2个文件已修改
11 ■■■■ 已修改文件
zy-acs-flow/.env 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/vite.config.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/.env
@@ -1,2 +1,2 @@
COOL_BASE_IP=192.168.1.100
COOL_BASE_PORT=8080
VITE_BASE_IP=192.168.1.100
VITE_BASE_PORT=8080
zy-acs-flow/vite.config.js
@@ -5,7 +5,6 @@
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
  const env = loadEnv(mode, process.cwd());
  console.log('Loaded environment variables:', env);
  return {
    plugins: [react()],
    resolve: {
@@ -18,18 +17,18 @@
      host: '0.0.0.0',
      proxy: {
        '/api': {
          target: `http://${env.COOL_BASE_IP}:${env.COOL_BASE_PORT}`,
          target: `http://${env.VITE_BASE_IP}:${env.VITE_BASE_PORT}`,
          changeOrigin: true,
          // rewrite: (path) => path.replace(/^\/api/, ''),
        },
        '/ws': {
          target: `ws://${env.COOL_BASE_IP}:${env.COOL_BASE_PORT}`,
          target: `ws://${env.VITE_BASE_IP}:${env.VITE_BASE_PORT}`,
          changeOrigin: true,
          ws: true,
        },
      },
    },
    base: './',
    envPrefix: 'COOL_',
    envPrefix: 'VITE_',
  };
});