const proxy = {
  '/auth': {
    // target: 'http://home.robot-z.cn:7001',
    target: 'https://es.robot-z.cn',
    changeOrigin: true,
    secure: false,
    pathRewrite: { '^/auth': '' },
    onProxyRes: function (proxyRes) {
      proxyRes.headers['Access-Control-Allow-Origin'] = '*';
      proxyRes.headers['Access-Control-Allow-Methods'] = 'GET,PUT,POST,DELETE,OPTIONS';
      proxyRes.headers['Access-Control-Allow-Headers'] = 'Content-Type, Authorization';
      proxyRes.headers['Access-Control-Allow-Credentials'] = 'true';
    }
  },
  // '/kaipiao': {
  //   // target: 'https://cosmic-sandbox.piaozone.com/xhcamzchwbgonerr/',
  //   target: 'https://cosmic.piaozone.com/ynjtjtjykf/',
  //   changeOrigin: true,
  //   secure: false,
  //   pathRewrite: { '^/kaipiao': '' },
  //   onProxyRes: function (proxyRes) {
  //     proxyRes.headers['Access-Control-Allow-Origin'] = '*';
  //     proxyRes.headers['Access-Control-Allow-Methods'] = 'GET,PUT,POST,DELETE,OPTIONS';
  //     proxyRes.headers['Access-Control-Allow-Headers'] = 'Content-Type, Authorization, X-Requested-With';
  //     proxyRes.headers['Access-Control-Allow-Credentials'] = 'true';
  //   }
  // }
}

export default proxy;
