
import { getApp } from '@/app'

const notOpenUrls = [
]

let loading

export const openLoading = (url) => {
  // if (loading) return;
  if (loading || ~notOpenUrls.indexOf(url)) return;

  loading = getApp().$loading({
    lock: true,
    text: '加载中',
    spinner: 'el-icon-loading',
    background: 'rgba(255, 255, 255, 0.4)',
    customClass: 'loading'
  });
}

export const closeLoading = () => {
  if (loading) {
    loading.close()
    loading = void 0
  }
}
