#
luxiaotao1123
2024-11-25 5f5be4ec72876394814126ad6875b82f581a6aa1
#
4个文件已修改
44 ■■■■ 已修改文件
zy-acs-flow/.env 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/config/setting.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/utils/request.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/vite.config.js 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/.env
@@ -1,6 +1,2 @@
# COOL_BASE_IP = '10.242.136.69'
COOL_BASE_IP = 'localhost'
# COOL_BASE_IP = '10.10.10.200'
# COOL_BASE_IP = '192.168.4.53'
COOL_BASE_PORT = 8088
COOL_BASE_IP=192.168.1.100
COOL_BASE_PORT=8080
zy-acs-flow/src/config/setting.js
@@ -5,7 +5,7 @@
export const API_BASE_URL = 'http://' + IP + ':' + PORT + '';
export const WEBSOCKET_BASE_URL = 'ws://' + IP + ':' + PORT + '';
export const WEBSOCKET_BASE_URL = `${window.location.protocol === 'https:' ? 'wss://' : 'ws://'}${window.location.host}`;
export const PREFIX_BASE_URL = '/api/';
zy-acs-flow/src/utils/request.js
@@ -3,7 +3,7 @@
import { getToken, setToken, removeToken } from './token-util';
const service = axios.create({
    baseURL: API_BASE_URL + PREFIX_BASE_URL
    baseURL: PREFIX_BASE_URL
});
/**
zy-acs-flow/vite.config.js
@@ -3,32 +3,9 @@
import { resolve } from 'path';
// https://vitejs.dev/config/
// export default defineConfig({
//   plugins: [react()],
//   resolve: {
//     alias: {
//       '@/': resolve('src') + '/'
//     }
//   },
//   server: {
//     port: 5000,
//     host: '0.0.0.0',
//     proxy: {
//       '/api': {
//         target: 'http://192.168.4.53:8088',
//         changeOrigin: true,
//         rewrite: (path) => path.replace(/^\/api/, ''),
//       },
//     },
//   },
//   base: './',
//   envPrefix: "COOL_",
// });
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
  const env = loadEnv(mode, process.cwd());
  console.log('Loaded environment variables:', env);
  return {
    plugins: [react()],
    resolve: {
@@ -43,7 +20,12 @@
        '/api': {
          target: `http://${env.COOL_BASE_IP}:${env.COOL_BASE_PORT}`,
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/api/, ''),
          // rewrite: (path) => path.replace(/^\/api/, ''),
        },
        '/ws': {
          target: `ws://${env.COOL_BASE_IP}:${env.COOL_BASE_PORT}`,
          changeOrigin: true,
          ws: true,
        },
      },
    },