gaoshp
3 天以前 87cdebbfaf95a872368dd45264dc825e98436422
vite.config.mjs
@@ -1,3 +1,9 @@
/*
 * @Date: 2025-05-27 23:44:41
 * @LastEditors: gaoshp
 * @LastEditTime: 2025-06-16 11:56:09
 * @FilePath: /mdmweb/vite.config.mjs
 */
import {
  defineConfig,
  loadEnv
@@ -9,6 +15,11 @@
  mode,
  command
}) => {
  let target = 'http://120.46.212.231:80';
  if(mode === 'test') {
    target = 'http://localhost:80';
    console.log('当前环境:',mode,command);
  }
  const env = loadEnv(mode, process.cwd())
  const {
    VITE_APP_ENV,
@@ -54,7 +65,7 @@
      port: 2888,
      proxy: {
        '/api': {
          target: 'http://localhost',
          target,
          //target: 'https://saber3.bladex.cn/api',
          changeOrigin: true,
          rewrite: path => path.replace(/^\/api/, ''),