/*
 * @Author: code4eat awesomedema@gmail.com
 * @Date: 2024-04-09 18:07:34
 * @LastEditors: code4eat awesomedema@gmail.com
 * @LastEditTime: 2025-05-21 17:30:57
 * @FilePath: /KC-MiddlePlatform/config/proxy.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

const proxy: { [key: string]: any } = {
  dev: {
    '/gateway': {
      //target: 'http://47.96.149.190:5000',
      target: 'http://120.27.235.181:5000',
      //target: 'http://platform.pre.bs.qjczt.com:5000',
      changeOrigin: true,
      // pathRewrite: { '^/master': '' },
    },
    '/api': {
      target: 'http://120.27.235.181:8088',
      changeOrigin: true,
    },
    '/ai': {
      target: 'http://192.168.0.120:5003',
      //target: 'http://116.62.47.88:5003',
      changeOrigin: true,
      pathRewrite: { '^/ai': '' },
      selfHandleResponse: true,
      onProxyRes: function onProxyRes(proxyRes: any, req: any, res: any) {
        proxyRes.on('data', function (data: any) {
          res.write(data);
        });
        proxyRes.on('end', function () {
          res.end();
        });
      },
    },
  },
  mock: {
    '/master/': {
      target: 'http://localhost:8000',
      changeOrigin: true,
      pathRewrite: { '^': '' },
    },
  },
};

export default proxy;
