提升用户体验之线上环境不打印日志

18 阅读1分钟

将window.console.log置为空函数

if (process.env.NODE_ENV === 'production') {
  window.console.log = () => {};
}