(function (doc, win) {
  var docEl = doc.documentElement,
    resizeEvt = 'onorientationchange' in window ? 'onorientationchange' : 'resize',
    recalc = function () {
      var clientWidth = docEl.clientWidth;
      if (!clientWidth) return;
      if (clientWidth < 1700) {
        docEl.style.fontSize = '150px';
      } else if ( 1700>=clientWidth>2000 ){
        docEl.style.fontSize = '170px';
      }else{
        docEl.style.fontSize = '170px';
        // docEl.style.fontSize = 100 * (clientWidth / 1400) + 'px';
      }
    };

  if (!doc.addEventListener) return;
  win.addEventListener(resizeEvt, recalc, false);
  doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);

export const dva = {
  config: {
    onError(e) {
      e.preventDefault();
      console.error(e);
    },
  },
};