import Vue from 'vue'
import App from './App.vue'
import store from '@/store'
import { h5Router } from '@/router'
import { Loading } from 'element-ui'

import Invite from '@/components/popup/invite'
import Avatar from '@/components/popup/avatar'
import Info from '@/components/popup/userInfo'
import otherInfo from '@/components/popup/otherInfo'
import imgPreview from '@/components/popup/imgPreview'
import packetGet from '@/components/popup/packetGet'
import packetSend from '@/components/popup/packetSend'
import Toast from '@/components/popup/toast'
import VueClipboard from 'vue-clipboard2'
import directive from '@/plugins/directive'
// 引用公共模块
import '../common'

import i18n from '@/util/lang/lang'
// import { register } from 'register-service-worker'
// import { MessageBox } from 'element-ui'
Vue.use(Invite, store)
Vue.use(Avatar, store)
Vue.use(Info, store)
Vue.use(otherInfo, store)
Vue.use(packetGet, store)
Vue.use(packetSend, store)
Vue.use(Toast)
Vue.use(VueClipboard)
Vue.use(directive)
Vue.use(imgPreview)
Vue.use(Loading)
Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router: h5Router,
  i18n,
  store
}).$mount('#app')

if (!(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
  location.replace('/pc.html' + location.search + location.hash)
}
