p-honggang.li
5 天以前 751dfe21d19a22bb130a6a14857470868d7be53a
vite.config.ts
@@ -17,13 +17,24 @@
const viteConfig = ({ mode }: ConfigEnv): UserConfig => {
  let proxy: Record<string, string | ProxyOptions> = {}
  proxy = {
    '/api/report': {
      target: 'http://36.133.126.111:7099',
      changeOrigin: true,
      // rewrite: (path) => path.replace(/^\/api/, '/'),
    },
    '/api1': {
      target: 'http://36.133.126.111:7099',
      changeOrigin: true,
       rewrite: (path) => path.replace(/^\/api1/, '/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:8089',
       target: 'http://36.133.126.111:7099/trade-api',
      changeOrigin: true, // 允许跨域
      rewrite: (path) => path.replace(/^\/api/, '/'), //连测试环境要注释这行,连后端个人则打开
    },
@@ -71,7 +82,7 @@
        '@': path.resolve(__dirname, './src'),
      },
    },
    base: '/manage/',
    base: '/trade/',
    server: {
      host: '0.0.0.0',
      port: 1000,