shuishen
2025-10-11 3fc27febccd04e2fcffbd2cdd16d2daafd0b3ca3
build/config/proxy.js
@@ -9,15 +9,15 @@
 * 2025-09-28 09:31:16
 */
export const createViteProxy = (env) => {
  const { VITE_APP_PROXY, VITE_API_PREFIX, VITE_API_BASE_URL } = env;
  const { VITE_APP_PROXY, VITE_API_PREFIX, VITE_API_BASE_URL } = env
  // 不使用代理直接返回
  if (!JSON.parse(VITE_APP_PROXY)) return undefined;
  if (!JSON.parse(VITE_APP_PROXY)) return undefined
  const proxy = {
    [VITE_API_PREFIX]: {
      target: VITE_API_BASE_URL,
      changeOrigin: true,
      rewrite: path => path.replace(new RegExp(`^${VITE_API_PREFIX}`), ''),
    },
  };
  return proxy;
};
  }
  return proxy
}