import Vue from "vue"
import { getStorage, setStorage } from "@/lib/storage/index.js"
import Toast from "@/lib/toast/index.js"
import Modal from '@/lib/modal/index.js'
import { checkLogin } from '@/utils/modules/login.js'
import globalMixins from '@/mixins/globalMixins.js'
import dayjs from 'dayjs'

Vue.prototype.$getStorage = getStorage
Vue.prototype.$setStorage = setStorage
Vue.prototype.$toast = Toast
Vue.prototype.$modal = Modal
Vue.prototype.$checkLogin = checkLogin

Vue.filter('parseTime', timestamp => {
	if (!~~timestamp) return '——'
	return dayjs(timestamp * 1000).format('YYYY-MM-DD HH:mm:ss')
})
Vue.mixin(globalMixins)