seatonwan9
2025-08-28 14da39a3d869f252bf235b49c634c83998bc5660
vite.config.ts
@@ -17,13 +17,19 @@
const viteConfig = ({ mode }: ConfigEnv): UserConfig => {
  let proxy: Record<string, string | ProxyOptions> = {}
  proxy = {
    '/api/test': {
      target: 'http://36.133.126.111:7099',
      changeOrigin: true,
      rewrite: (path) => path.replace(/^\/api\/test/, '/api'),
    },
    '/api': {
      // target: 'http://192.168.0.38:8088', // 李
      // target: 'http://10.88.211.191:8088', // 李
      // target:'http://10.209.233.16/admin',//信创正式
      // target: 'http://36.133.126.111:7099/api', //测试
      // target: 'https://zynlpt.ccccltd.cn/admin', // 正式  (要打开changeOrigin和rewrite)
         target: 'http://localhost:8080',
      //    target: 'http://localhost:8080',
         target: 'http://36.133.126.111:7099/trade-api',
      changeOrigin: true, // 允许跨域
      rewrite: (path) => path.replace(/^\/api/, '/'), //连测试环境要注释这行,连后端个人则打开
    },