function InitDog() {
  const dog = {};
  dog.error = ({msg = '服务器错误', defaultMsg = '服务器错误', time = 2000, onClose}) => {
    if (typeof msg === 'object') {
      if (msg.responseJSON) {
        const r = msg.responseJSON;
        msg = r && r.data || defaultMsg
      }
    }
    return layui.layer.msg(
      '<i class="fa-solid fa-circle-exclamation"></i>' + msg, {
      offset: '15px',
      anim: 'slideDown',
      time: time,
      skin: 'dog error',
      end: onClose
    })
  };
  dog.success = ({msg = '操作成功', defaultMsg = '操作成功', time = 2000, onClose}) => {
    return layui.layer.msg(
      '<i class="fa-solid fa-circle-check"></i>' + msg, {
      offset: '15px',
      anim: 'slideDown',
      time: time,
      skin: 'dog success',
      end: onClose
    })
  };
  dog.reloadTable = (tableFilter) => {
    if (!tableFilter) {
      tableFilter = document.querySelector('table[lay-filter]').getAttribute('lay-filter');
    }
    layui.table.reload(tableFilter, {
      page: {
        curr: $('.layui-laypage-em').next().html()
      }
    })
  }
  return dog;
}
const Dog = window.Dog = InitDog();