const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'
import store from '@/store/index.js'  
export default {
	isLogin() {
		if(uni.getStorageSync('union_id')){
			return true;
		}else{
			return false
		}
	},
	splitImgHost(url) {
		if(!url){
			return ''
		}
		if(url.indexOf("http") != -1||url.indexOf("https") != -1){
			return url;
		}
		return BASE_IMG_URL+url
	},
	exit() {
		uni.removeStorageSync('union_id')
		uni.removeStorageSync('token')
		store.state.userInfo = null
		uni.reLaunch({
			url: '/pages/index/index'
		});
	},
}
